Col
Col defines responsive grid columns inside row-based layouts.
@duskmoon-dev/components/col Usage
When to use
- Use it to build predictable page, toolbar, panel, or grid structure.
- Keep layout primitives responsible for geometry and let child components own behavior.
Implementation notes
Features
Documents spacing, responsive behavior, and nested regions used to build larger screens.
Examples keep predictable dimensions so the surrounding UI does not jump while content changes.
Col is most often configured through `flex`, `offset`, `order`, `pull`.
Renders span, offset, order, push, pull, flex, and responsive metadata
Feature Demos
Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.
Basic usage
Import the component stylesheet and Col from its package subpath, then render it with the core props.
import "@duskmoon-dev/components/styles.css";
import { Col } from "@duskmoon-dev/components/col";
export function Example() {
return (<Col
span={12}
style={{
width: "50%",
padding: "12px",
background: "var(--color-primary-container)",
color: "var(--color-primary)",
borderRadius: "6px",
fontWeight: 700
}}
>
span 12
</Col>);
} Renders span, offset, order, push, pull, flex, and responsive metadata
test-backedCol scenario from the component test coverage: renders span, offset, order, push, pull, flex, and responsive metadata.
import "@duskmoon-dev/components/styles.css";
import { Col } from "@duskmoon-dev/components/col";
export function ColRendersSpanOffsetOrderDemo() {
return (<Col
span={12}
style={{
width: "50%",
padding: "12px",
background: "var(--color-primary-container)",
color: "var(--color-primary)",
borderRadius: "6px",
fontWeight: 700
}}
>
span 12
</Col>);
} Theme aware
Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.
<div data-theme="sunshine">
<Col
span={12}
style={{
width: "50%",
padding: "12px",
background: "var(--color-primary-container)",
color: "var(--color-primary)",
borderRadius: "6px",
fontWeight: 700
}}
>
span 12
</Col>
</div>
<div data-theme="moonlight">
<Col
span={12}
style={{
width: "50%",
padding: "12px",
background: "var(--color-primary-container)",
color: "var(--color-primary)",
borderRadius: "6px",
fontWeight: 700
}}
>
span 12
</Col>
</div> API
The API reference below lists every parsed exported type or interface for Col. Start with `flex`, `offset`, `order`, `pull` for common usage.
packages/components/src/components/col/Col.types.ts
Scenarios: packages/components/src/components/col/Col.test.tsx | Prop | Type | Required | Description |
|---|---|---|---|
flex | string | number | No | flex configures Col. |
offset | number | No | offset configures Col. |
order | number | No | order configures Col. |
pull | number | No | pull configures Col. |
push | number | No | push configures Col. |
span | ColSpan | No | span configures Col. |
xs | ColResponsiveValue | No | xs configures Col. |
sm | ColResponsiveValue | No | sm configures Col. |
md | ColResponsiveValue | No | md configures Col. |
lg | ColResponsiveValue | No | lg configures Col. |
xl | ColResponsiveValue | No | xl configures Col. |
xxl | ColResponsiveValue | No | xxl configures Col. |
children | ReactNode | No | children configures Col. |
number | number | { span?: number