Foundations
Dalvan UI React components use the same stylesheet and design tokens as the HTML/CSS components. Follow Installation to load the stylesheet once at the app entry point.
Component props
Choose the size, palette, and appearance independently. Use the supported props for the component and className for utilities and local styling.
import { Chip } from "@dalvan-ui/react";
<Chip size="sm" color="success" appearance="subtle">
Published
</Chip>
This renders the same base class, size modifier, palette, and appearance as the HTML chip in CSS Foundations.
| Prop | CSS class |
|---|---|
size="sm" | dv-chip--sm |
color="success" | dv-color-success |
appearance="subtle" | dv-appearance-subtle |
Use the CSS classes directly in JSX for components assembled from native elements, such as a Card.
Utilities and layout
Use classes such as dv-gap-100 through className. For layout, Flex and Grid also accept responsive props.
import { Chip, Flex } from "@dalvan-ui/react";
<Flex direction={{ base: "column", md: "row" }} className="dv-gap-100">
<Chip color="success" appearance="subtle">Published</Chip>
<Chip color="neutral" appearance="subtle">Draft</Chip>
</Flex>
Design tokens and themes
Set CSS custom properties in your stylesheet and apply the theme attribute to an ancestor in JSX. Components inside that subtree inherit the shared values.
<section data-dv-theme="editorial">
<article className="dv-card">
<div className="dv-card__body dv-text-body-md">Project summary</div>
</article>
</section>
Define the matching selector in your stylesheet as shown in CSS Foundations. Set the attribute on the document’s <html> element to apply it page-wide.