One part of a landing page: the room around it, an eyebrow, title, description and buttons, and its content in a Container.
$ pnpm dlx shadcn@latest add @dashral/sectionWhy teams switch
Everything a dashboard needs, already built
Sign-in, roles, charts and exports are done, so your first week goes into what makes your product different.
Live in minutes
Connect your database and the first dashboard draws itself from your tables.
Charts that read
Numbers count to their new value, and every chart has a table behind it.
Yours to run
Self-host it or deploy it anywhere; your data never leaves your servers.
Installation
$ pnpm dlx shadcn@latest add @dashral/sectionAdds the component, the components it builds on, its npm packages and the theme tokens it uses. Or by its full URL: https://dashral.com/r/section.json
When to use
- Each part of a landing page: features, pricing, testimonials, a FAQ, the last call to action.
When not to use
- A part of a settings page: Form Section.
- A page's width alone, with no heading: Container.
Usage
The heading rises into place as it scrolls into view; the content sits under it.
import { Section } from "@/components/dashral/section"
export default function Features() {
return (
<Section eyebrow="Why teams switch" title="Everything a dashboard needs" description="Sign-in, roles, charts and exports are done.">
<div className="grid gap-4 sm:grid-cols-3">
<p>Live in minutes</p>
<p>Charts that read</p>
<p>Yours to run</p>
</div>
</Section>
)
}Using the npm package? Import from @dashral/ui/components/section instead, here and in the examples; the rest is the same.
Examples
API reference
Section
Also takes every prop of <section>(opens in a new tab).
| Prop | Type | Default |
|---|---|---|
eyebrow | ReactNodeA short line above the title: what the part is about. | — |
title | ReactNodeThe part's heading; it names the section too. | — |
description | ReactNodeA sentence or two under the title. | — |
actions | ReactNodeUnder the description: the part's buttons. | — |
children | ReactNodeThe part's content, under the heading. | — |
align | "center" | "start"The heading centred over the content, or at its start. | "center" |
titleAs | "h1" | "h2"The heading's level: h1 for the page's first part. | "h2" |
size | "sm" | "md" | "lg" | "xl" | "full"The content's width, as Container's. | "lg" |
spacing | "sm" | "default" | "lg"The room above and below: 48/64px, 64/96px or 96/128px (phone/sm up). | "default" |
tone | "default" | "muted"muted lays a faint band behind it. | "default" |
reveal | booleanThe heading rises into place the first time it scrolls into view. | true |
classNames | { container, header, eyebrow, title, description, actions, content }Classes for each part. | — |
className | stringExtra classes, merged with cn() so yours win. | — |
Accessibility
- A <section> named by its title (aria-labelledby), so it's a region screen readers can jump to; without a title it's left unnamed.
- One h1 per page: give titleAs="h1" to the first part only.
Motion
- The heading's lines rise 12px and fade in, a beat apart, the first time it scrolls into view. Before scripts run, and with reduced motion, it's simply there.