Skip to content

Section

@astryxdesign/core v0.7.1 · Section

Section Props ​

NameTypeDefaultDescription
variant'section' | 'transparent' | 'muted''section'Background. section uses the surface, muted uses the wash, and transparent paints nothing.
paddingSpacingStep4Padding on every edge. 0 is edge-to-edge content.
paddingInlineSpacingStep-Inline-axis padding. Overrides padding on that axis.
paddingInlineStartSpacingStep-Inline-start padding. Overrides the broader values on that edge. The physical edge follows writing direction.
paddingInlineEndSpacingStep-Inline-end padding. Overrides the broader values on that edge.
paddingBlockSpacingStep-Block-axis padding. Overrides padding on that axis.
paddingBlockStartSpacingStep-Block-start padding. Overrides the broader values on that edge.
paddingBlockEndSpacingStep-Block-end padding. Overrides the broader values on that edge.
dividersArray<'top' | 'bottom' | 'start' | 'end'>-Edges that draw a 1px border. start and end follow writing direction.
widthnumber | string-Width. Numbers are pixels, strings are used as they are.
heightnumber | string-Height. Numbers are pixels, strings are used as they are.
maxWidthnumber | string-Maximum width. Numbers are pixels, strings are used as they are.
minHeightnumber | string-Minimum height. Numbers are pixels, strings are used as they are.

SpacingStep accepts 0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10.

Slots ​

NameDescription
defaultContent inside the section.

Native attributes ​

Section renders a <div>.

The following go to that element:

  • HTML attributes.
  • aria-* attributes.
  • data-* attributes.
  • class.
  • style.

class is merged. The inner element sets data-variant and data-divider-* for each requested edge.