@ds-gn/ui
Framework-agnostic web components and React wrappers for the DS-GN Design System.
Public Beta · Website · Documentation · Component reference · Changelog · Public repository
npm's Repository link points to our private build repository, which is required for Trusted Publishing. For examples and issue reporting, visit our public design-system repository.
Install
Choose your package manager:
npm install @ds-gn/ui @ds-gn/tokens
pnpm add @ds-gn/ui @ds-gn/tokens
bun add @ds-gn/ui @ds-gn/tokens
Install the tokens package directly because your application imports its
stylesheets. Both packages come from public npm and require no .npmrc or
entitlement token.
Quick start
Import the design tokens once in your application stylesheet:
@import '@ds-gn/tokens/public';
@import '@ds-gn/tokens/theme';
@import '@ds-gn/tokens/properties';
All three are required. properties registers the typed custom properties the
components' styles depend on — a shadow root cannot register @property
itself, so without this import those styles are silently dropped rather than
erroring (transforms stop applying, anchored panels land in the wrong place).
Then import only the components you use. Importing a component registers its custom element:
import '@ds-gn/ui/button';
<dsgn-button appearance="outline">Get started</dsgn-button>
React
Official React wrappers are generated for every component. React is an optional peer dependency, so install it in your application.
import { Button } from '@ds-gn/ui/react';
export function Cta() {
return <Button appearance="outline">Get started</Button>;
}
The wrappers retain their plain component names (Button, Input, and so on).
Alias an import if it conflicts with a local component:
import { Button as DsgnButton } from '@ds-gn/ui/react';
Custom events are exposed as on<EventName> props named after their underlying
dsgn-* events, such as onDsgnInput and onDsgnImageError.
Package exports
| Export | Purpose |
|---|---|
@ds-gn/ui/<component> | Registers one custom element, such as button |
@ds-gn/ui/<component>/props | Component property definitions and supporting exports |
@ds-gn/ui/react | Typed React wrappers for every component |
@ds-gn/ui/logo | Logo string helpers |
@ds-gn/ui/logo/mark.svg | DS-GN logo mark |
@ds-gn/ui/logo/full.svg | Full DS/GN logo for light backgrounds |
@ds-gn/ui/logo/light.svg | Full DS/GN logo for light backgrounds |
@ds-gn/ui/logo/dark.svg | Full DS/GN logo for dark backgrounds |
@ds-gn/ui/layout.css | Optional pre-upgrade styles for page layout |
@ds-gn/ui/hero/fallback.css | Optional pre-upgrade styles for Hero |
@ds-gn/ui/playground-manifest | Machine-readable component playground metadata |
The string helpers inherit currentColor for theme-aware lettering and keep the slash orange. Use getLogoHtml({ size: 24 }) to render the full artwork at a given height with its accessible name.
Server rendering
- Node SSR hosts (including Next, Remix, Nuxt, SvelteKit, Astro, and TanStack
Start on Node): importing
@ds-gn/ui/reactduring server rendering is safe. The server emits an inert<dsgn-*>tag that upgrades on the client. Declarative Shadow DOM is not emitted, so a brief unstyled frame is possible before upgrade; the pre-upgrade stylesheets below cover the layout components. Reactive properties are applied client-side; passid,class, and similar values as normal attributes. - Cloudflare workerd (including TanStack Start on Workers): full SSR is not
currently supported because the custom element cannot be evaluated in the
worker runtime. Load the wrapper client-only, such as behind a
ClientOnlyboundary with a lazy import.
Before components register
When your HTML is rendered before the component scripts run (server rendering or static pages), import the optional pre-upgrade stylesheets in your page CSS:
@import '@ds-gn/ui/layout.css';
@import '@ds-gn/ui/hero/fallback.css'; /* only if you use dsgn-hero */
They apply only until each element registers. layout.css holds Container,
Nav, FeatureTabs and Footer to their final gutters and section spacing,
reserves the nav bar's height, and keeps the nav's links and dropdowns hidden
until it lays them out. hero/fallback.css does the same for every Hero
layout. Without them, content can shift or flash as unstyled text while the
scripts load.
Public Beta components and compatibility policy
The Public Beta includes 32 custom elements:
| Group | Included components |
|---|---|
| App-capable | Button (dsgn-button), DropdownMenu (dsgn-dropdown-menu), Field (dsgn-field), Input (dsgn-input), Modal (dsgn-modal), SegmentedControl (dsgn-segmented-control), Select (dsgn-select), Table (dsgn-table), Toaster (dsgn-toaster) |
| Display and layout | Background (dsgn-background), Badge (dsgn-badge), Card (dsgn-card), CodeBlock (dsgn-code-block), Container (dsgn-container), Divider (dsgn-divider), Grid (dsgn-grid), Stack (dsgn-stack) |
| Content | Heading (dsgn-heading), Text (dsgn-text), Icon (dsgn-icon), Image (dsgn-image), Callout (dsgn-callout), CodeSnippet (dsgn-code-snippet) |
| Marketing and composition | Hero (dsgn-hero), HeadingBlock (dsgn-heading-block), FeatureItem (dsgn-feature-item), FeatureTabs (dsgn-feature-tabs), FormBlock (dsgn-form-block) |
| Navigation | Nav (dsgn-nav), NavLink (dsgn-nav-link), NavDropdownColumn (dsgn-nav-dropdown-column), Footer (dsgn-footer) |
Modal ships in the Public Beta. No currently exported custom element is excluded. The aurora mesh engine is an internal rendering helper, not a custom element or package export. Avatar and the other app-grade components on the roadmap are post-launch work.
While the package remains 0.x:
- The listed components are supported for consumer evaluation and production
trials, but their APIs may change before
1.0. - Patch releases do not intentionally break documented APIs. Planned breaking changes ship in a minor release with migration guidance.
- A deprecated API remains available for at least one complete minor release and at least 90 days, whichever is longer, before removal. Security, legal, or broken-platform emergencies may require faster changes.
- The compatibility contract covers documented component subpaths, custom element tags, attributes and properties, slots, methods, events, CSS parts and custom properties, and generated React wrappers. Undocumented internals are not public API.
Support
Search or report package issues in the public issue tracker. For questions, email [email protected].
License
This package is available under the MIT License included in LICENSE.
Third-party materials included in the distribution remain subject to the
licenses listed in THIRD_PARTY_NOTICES.