Log In Sign Up
HomeDocsBasicLine Space

Line Space

Category: Basic
The line component displays a divider to distinguish contexts, with the default effect being consistent with the hr tag. In addition to displaying a horizontal divider, the line component can also dis...

Preface

The native <hr> tag only provides horizontal dividers. However, there are scenarios where vertical dividers between columns are needed, or when we want to add descriptive text within the divider. This makes custom divider components essential for modern UI development.

HR Tag Styling

The framework has enhanced the default <hr> tag styling to display as a clean 1px horizontal divider.

  • Output
  • HTML
  • The United States has the world’s largest economy and plays a dominant role in international politics, defense, technology, and entertainment. It is a federal republic with a diverse population and a strong tradition of democracy and free enterprise. From Silicon Valley to Hollywood, the U.S. drives global trends in science, media, and culture. Its institutions, military reach, and entrepreneurial spirit shape much of the modern world.


    South Korea is a global leader in innovation, with major companies like Samsung and Hyundai driving its economy. It's also a cultural powerhouse thanks to the global popularity of K-pop, Korean dramas, and fashion. With a strong education system and urban infrastructure, South Korea maintains rapid development while preserving Confucian values and rich historical sites.

  •                 
                    
                

Line Component

The <oc-line> component is the framework's custom divider element, with default styling matching the <hr> tag.

  • Output
  • HTML
  • The United States has the world’s largest economy and plays a dominant role in international politics, defense, technology, and entertainment. It is a federal republic with a diverse population and a strong tradition of democracy and free enterprise. From Silicon Valley to Hollywood, the U.S. drives global trends in science, media, and culture. Its institutions, military reach, and entrepreneurial spirit shape much of the modern world.

    South Korea is a global leader in innovation, with major companies like Samsung and Hyundai driving its economy. It's also a cultural powerhouse thanks to the global popularity of K-pop, Korean dramas, and fashion. With a strong education system and urban infrastructure, South Korea maintains rapid development while preserving Confucian values and rich historical sites.

  •                 
                    
                

Vertical lines

By default, lines are horizontal. To create vertical lines:

  1. Add the dir="v" attribute (vertical)
  2. Explicitly set height via style attribute if parent container lacks defined height

Important: Vertical lines won't auto-extend height without explicit parent container height.

  • Output
  • HTML
  • The United States has the world’s largest economy and plays a dominant role in international politics, defense, technology, and entertainment. It is a federal republic with a diverse population and a strong tradition of democracy and free enterprise. From Silicon Valley to Hollywood, the U.S. drives global trends in science, media, and culture. Its institutions, military reach, and entrepreneurial spirit shape much of the modern world.

    South Korea is a global leader in innovation, with major companies like Samsung and Hyundai driving its economy. It's also a cultural powerhouse thanks to the global popularity of K-pop, Korean dramas, and fashion. With a strong education system and urban infrastructure, South Korea maintains rapid development while preserving Confucian values and rich historical sites.

    The United States has the world’s largest economy and plays a dominant role in international politics, defense, technology, and entertainment. It is a federal republic with a diverse population and a strong tradition of democracy and free enterprise. From Silicon Valley to Hollywood, the U.S. drives global trends in science, media, and culture. Its institutions, military reach, and entrepreneurial spirit shape much of the modern world.

    South Korea is a global leader in innovation, with major companies like Samsung and Hyundai driving its economy. It's also a cultural powerhouse thanks to the global popularity of K-pop, Korean dramas, and fashion. With a strong education system and urban infrastructure, South Korea maintains rapid development while preserving Confucian values and rich historical sites.

  •                 
                    
                

Adding Labels

There are two ways to add text labels to dividers:

  1. Using the label attribute
  2. Placing text directly inside the component
  • Output
  • HTML
  • The United States has the world’s largest economy and plays a dominant role in international politics, defense, technology, and entertainment. It is a federal republic with a diverse population and a strong tradition of democracy and free enterprise. From Silicon Valley to Hollywood, the U.S. drives global trends in science, media, and culture. Its institutions, military reach, and entrepreneurial spirit shape much of the modern world.

    A line

    South Korea is a global leader in innovation, with major companies like Samsung and Hyundai driving its economy. It's also a cultural powerhouse thanks to the global popularity of K-pop, Korean dramas, and fashion. With a strong education system and urban infrastructure, South Korea maintains rapid development while preserving Confucian values and rich historical sites.

    As the world’s largest democracy and most populous nation, India is rich in languages, religions, and traditions. Its economy is rapidly expanding, particularly in technology, space research, and pharmaceuticals. Home to both ancient monuments and a booming startup scene, India blends deep-rooted spirituality with modern ambition. Festivals like Diwali and Holi symbolize its vibrant cultural life.

  •                 
                    
                

Label Alignment

Control label positioning with the align attribute:

Line Thickness

Customize divider thickness via the size attribute:

Color Themes

Apply color schemes using the theme attribute:

Line Types

Change divider appearance with type attribute:

Interactive Example

Here's an example to demonstrate: changing the state of the divider by modifying its properties.

Attributes

Name Values Default Description
type 'solid'/'dashed'/'slash' 'solid' Divider line style
theme 'prim'/'error'/'succ'/
'info'/'warn'/'issue'/'text'
- Color theme
label string - Divider label text
align 'center'/'start'/'end' 'center' Text alignment
size 'sm'/'md'/'lg' - Line thickness (sm=2px, md=4px, lg=8px)
break 'xxs'/'xs'/'sm'/'md'/
'lg'/'xl'/'xxl'
- Spacing around divider
dir 'h'/'v' 'h' Divider orientation

Methods

Common component methods:

  • set: Set properties (takes key-value pairs or array)
  • reset: Reset properties (no params)
  • clear: Clear properties and values (no params)

Basic usage: CompElem.reset()

Events

Common component events:

  • connected: Component connected (no params)
  • disconnected: Component disconnected (no params)
  • adopted: Component moved (no params)
  • set: Property set (receives value)
  • cleared: Property cleared (no params)
  • reset: Property reset (no params)

Basic usage: CompElem.on('connected',()=>{console.log('connected')})

New Launch: 20% Off All Products

Unlock all examples and development resources