Primitives
Section
A utility for setting structure on a group of elements.
Definition and Usage
The section component basically and wrapper for a group of related elements. A simple example is a header or navbar.
Wrap the elements in Section.RootElement and an inner wrapper Section.Container which applies a max width to its
content and centers them horizontally.
import Section from "@_ndk/ui/components/_ui/section";
export default function Navbar() {
return (
<Section.RootElement className="">
<Section.Container container="8xl" className="">
<div className="">
<h2> A simple section </h2>
</div>
</Section.Container>
</Section.RootElement>
);
}Installation
Copy and paste the following code into your project:
Update the import paths to match your project setup.
Also Add the following snippets to your globals css file if you are installing manually.
.container,
[datatype="container"] {
@apply mx-auto max-w-4xl;
}
.container-5xl,
[datatype="container-5xl"] {
@apply mx-auto max-w-5xl;
}
.container-6xl,
[datatype="container-6xl"] {
@apply mx-auto max-w-6xl;
}
.container-7xl,
[datatype="container-7xl"] {
@apply mx-auto max-w-7xl;
}
.container-8xl,
[datatype="container-8xl"] {
@apply mx-auto max-w-5xl;
}Props
Background.RootElement
Prop
Type
Background.Container
Prop
Type