Divider
A divider is a thin line that groups content in lists and layouts.
import {QDivider} from "@qui/react"
Examples
Showcase
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
import {ReactNode} from "react"import {QDivider} from "@qui/react"export default function Showcase(): ReactNode {return (<div className="flex flex-col gap-4 px-8"><span className="q-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua.</span><QDivider /><span className="q-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua.</span></div>)}
Orientation
Switch the layout to vertical using the orientation input.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
import {ReactNode} from "react"import {QDivider} from "@qui/react"export default function Orientation(): ReactNode {return (<div className="flex gap-4 px-8"><span className="q-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua.</span><QDivider orientation="vertical" /><span className="q-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua.</span></div>)}
Spacing
Apply additional spacing between the divider and its sibling elements using the spacing
input.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.import {ReactNode} from "react"import {QDivider} from "@qui/react"export default function Spacing(): ReactNode {return (<div className="flex flex-col gap-4 px-8"><div className="flex gap-4"><span className="q-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore magna aliqua.</span><QDivider orientation="vertical" spacingAfter={16} spacingBefore={16} /><span className="q-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed doeiusmod tempor incididunt ut labore et dolore magna aliqua.</span></div><QDivider spacingAfter={16} spacingBefore={16} /><span className="q-body-m">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmodtempor incididunt ut labore et dolore magna aliqua.</span></div>)}
API
Props
Name & Description | Option(s) | Default |
---|---|---|
Customize the accent for ideal contrast. Use secondary when the divider is
placed on an inverted contrast background. |
| 'primary' |
The component used for the root node. It can be a React component or
element. |
| 'div' |
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element. |
| |
Color of the divider. |
| 'default' |
Orientation of the divider. |
| 'horizontal' |
Apply additional spacing between the divider and its next element sibling.
When orientation is 'horizontal' , this translates to bottom margin.
When orientation is 'vertical' , this translates to right margin.
Numbers are converted to pixels. |
| 0 |
Apply additional spacing between the divider and its previous element
sibling. When orientation is 'horizontal' , this translates to top
margin. When orientation is 'vertical' , this translates to left
margin. Numbers are converted to pixels. |
| 0 |
The style global attribute
contains CSS styling
declarations to be applied to the element. | CSSProperties |
Type
| 'primary'| 'secondary'
Default
'primary'
Description
Customize the accent for ideal contrast. Use secondary when the divider is
placed on an inverted contrast background.
Type
| ElementType| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or
element.
Type
string
Description
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element.
Type
| 'subtle'| 'default'| 'strong'| 'focus'
Default
'default'
Description
Color of the divider.
Type
| 'horizontal'| 'vertical'
Default
'horizontal'
Description
Orientation of the divider.
Type
| string| number
Default
0
Description
Apply additional spacing between the divider and its next element sibling.
When orientation is
'horizontal'
, this translates to bottom margin.
When orientation is 'vertical'
, this translates to right margin.
Numbers are converted to pixels.Type
| string| number
Default
0
Description
Apply additional spacing between the divider and its previous element
sibling. When orientation is
'horizontal'
, this translates to top
margin. When orientation is 'vertical'
, this translates to left
margin. Numbers are converted to pixels.Type
CSSProperties
Description
The style global attribute
contains CSS styling
declarations to be applied to the element.