@streamsai/ui
The Streams design system: shadcn/ui components built on Base UI, design
tokens for light and dark themes, a theme provider and the Streams icon set. React 19 and Tailwind CSS v4.
Install
pnpm add @streamsai/ui react react-dom tailwindcss
react, react-dom and tailwindcss are peer dependencies.
Set up styles
In your Tailwind v4 CSS entry, import the package styles after Tailwind is available:
@import '@streamsai/ui/styles/globals.css';
This brings in Tailwind, the design tokens, the Figtree and Poppins fonts and a @source for the
package's compiled components, so the utility classes they use are generated in your build. Use
@streamsai/ui/styles/base.css instead if you load your own fonts.
Use
import { Button, ThemeProvider } from '@streamsai/ui'
export function App() {
return (
<ThemeProvider>
<Button>Save</Button>
</ThemeProvider>
)
}
Every component is also available as a subpath, for example
import { Button } from '@streamsai/ui/components/button'.
ThemeProvider toggles the dark class on <html>. To avoid a flash of the wrong theme, inline
THEME_INIT_SCRIPT (exported from the package) in your HTML before your app script.
Other entry points
| Import |
What it is |
@streamsai/ui/tokens |
Design token palette as JavaScript (colors, ...) with types |
@streamsai/ui/styles/tokens.css |
Token custom properties only |
@streamsai/ui/styles/mcp-host.css |
Maps the tokens to the MCP Apps host CSS variables |
@streamsai/ui/hooks/*, @streamsai/ui/lib/utils |
Shared hooks and the cn class merger |
Chat text size
One setting drives the size of chat text: --message-size / --message-lh in styles/tokens.css, used as text-message. Code is --code-scale (0.9) of it: --message-code-size, used as text-message-code in messages and documents, and the same scale inside the editor theme, so code in the composer, the edit box and a sent message always match. A client that wants larger chat text overrides --message-size and --message-lh only (the chat_larger_font flag does this on <html>). Do not hard-code a font size on chat text or code; a new type-scale class goes in the font-size group in lib/utils.ts.
License
MIT. The bundled Figtree and Poppins fonts are licensed under the SIL Open Font License (see
dist/styles/fonts/OFL.txt in the package).