···11+---
22+title: Theming
33+description: Easily theme your entire application or just a part of it.
44+---
55+66+import { Example } from "../../lib/Example";
77+import { ThemingExample } from "../../examples/foundations/theming";
88+99+Any of the foundations can be easily themed to match your brand.
1010+1111+This example renders the same card with the default tokens and then with a theme override.
1212+1313+<Example src={ThemingExample} />
1414+1515+## Creating a Theme
1616+1717+To start theming your application fist import the tokens you want to theme.
1818+1919+```tsx
2020+import { primaryColor, uiColor } from "@/components/theme/semantic-color.stylex";
2121+```
2222+2323+Then you can set the tokens to your desired values.
2424+2525+```tsx
2626+import * as stylex from "@stylexjs/stylex";
2727+2828+import { primaryColor, uiColor } from "@/components/theme/semantic-color.stylex";
2929+import { purple } from "@/components/theme/colors/purple.stylex";
3030+import { mauve } from "@/components/theme/colors/mauve.stylex";
3131+3232+export const myPrimaryColorTheme = stylex.createTheme(primaryColor, {
3333+ bg: purple.bg1,
3434+ bgSubtle: purple.bg2,
3535+ bgDim: purple.component1,
3636+ bgSecondary: purple.component2,
3737+ bgActive: purple.component3,
3838+ borderDim: purple.border1,
3939+ border: purple.border2,
4040+ borderInteractive: purple.border3,
4141+ bgSolid: purple.solid1,
4242+ bgSolidDark: purple.solid2,
4343+ textDim: purple.text1,
4444+ text: purple.text2,
4545+ textContrast: purple.textContrast,
4646+});
4747+4848+export const myUiColorTheme = stylex.createTheme(uiColor, {
4949+ bg: mauve.bg1,
5050+ bgSubtle: mauve.bg2,
5151+ bgDim: mauve.component1,
5252+ bgSecondary: mauve.component2,
5353+ bgActive: mauve.component3,
5454+ borderDim: mauve.border1,
5555+ border: mauve.border2,
5656+ borderInteractive: mauve.border3,
5757+ bgSolid: mauve.solid1,
5858+ bgSolidDark: mauve.solid2,
5959+ textDim: mauve.text1,
6060+ text: mauve.text2,
6161+ textContrast: mauve.textContrast,
6262+});
6363+```
6464+6565+## Applying a Theme
6666+6767+After that all you need to do is apply the theme to your application.
6868+6969+```tsx
7070+import { myPrimaryColorTheme, myUiColorTheme } from "./theme";
7171+import * as stylex from "@stylexjs/stylex";
7272+7373+export function MyApp() {
7474+ return (
7575+ <div {...stylex.props(myPrimaryColorTheme, myUiColorTheme)}>
7676+ <App />
7777+ </div>
7878+ );
7979+}
8080+```
8181+8282+> NOTE: you can apply a theme to any part of your application, not just the root component.
+47
apps/docs/src/docs/introduction.mdx
···11+---
22+title: Introduction
33+description: Bootstrap your project and design system with Hip UI.
44+---
55+66+import { Technology } from "../examples/introduction";
77+88+Hip UI is a design system for building modern web applications.
99+It provides a set of components and tokens that help you build your application quickly and efficiently with a consistent design system.
1010+1111+Hip UI itself is not a library that you install, rather it is a ready made design system that you copy directly into your project (like [shadcn/ui](https://ui.shadcn.com/docs)).
1212+This gives you as much or as little control as you need to build your application.
1313+You can use the components and tokens as is, or you can customize them to your liking.
1414+1515+The main difference between Hip UI and shadcn/ui is that Hip UI is built on two different technologies:
1616+1717+<Technology />
1818+1919+Beyond that we've taken extra care to include all the component you might need to render full applications.
2020+Whether thats navbars, footer, or page layouts, Hip UI has you covered.
2121+2222+## Installation
2323+2424+To get started with hip you can either install all the components at once:
2525+2626+```bash
2727+pnpx hip-ui install --all
2828+```
2929+3030+Or intall components one at a time as you need them:
3131+3232+```bash
3333+pnpx hip-ui install button
3434+pnpx hip-ui install typography
3535+pnpx hip-ui install flex
3636+pnpx hip-ui install content
3737+pnpx hip-ui install copy-to-clipboard-button
3838+pnpx hip-ui install tooltip
3939+```
4040+4141+## Navigating the docs
4242+4343+The docs are organized into the following categories:
4444+4545+- **Foundations** - The tokens that are use to build the design system and style your UI
4646+- **Components** - All the available components in Hip UI, organized by category
4747+- **Showcases** - Examples of how to use Hip UI in real world applications
···11+import {
22+ Disclosure,
33+ DisclosurePanel,
44+ DisclosureTitle,
55+} from "@/components/disclosure";
66+import { DisclosureGroup } from "@/components/disclosure-group";
77+import { Flex } from "@/components/flex";
88+import { Body } from "@/components/typography";
99+import { Text } from "@/components/typography/text";
1010+1111+export function Technology() {
1212+ return (
1313+ <DisclosureGroup allowsMultipleExpanded>
1414+ <Disclosure>
1515+ <DisclosureTitle>
1616+ <Text variant="primary" weight="normal">
1717+ <Text weight="bold">StyleX</Text> for styling instead of tailwindcss
1818+ </Text>
1919+ </DisclosureTitle>
2020+ <DisclosurePanel>
2121+ <Flex direction="column" gap="6">
2222+ <Body>
2323+ While tailwindcss is a great tool for styling, it is not great
2424+ when trying to maintain a design system. If you look at other
2525+ tools like Hip UI that rely on tailwindcss, you'll notice that the
2626+ output is very hard to understand and extend.
2727+ </Body>
2828+ <Body>
2929+ On the other hand, StyleX is a great tool for styling and is very
3030+ easy to understand and extend. It is also built for creating
3131+ design systems and is very easy to use and very easy to scale to
3232+ large projects. It also has great suuport for design tokens and
3333+ theming.
3434+ </Body>
3535+ </Flex>
3636+ </DisclosurePanel>
3737+ </Disclosure>
3838+ <Disclosure>
3939+ <DisclosureTitle>
4040+ <Text variant="primary" weight="normal">
4141+ <Text weight="bold">React Aria</Text> for accessibility and behavior
4242+ rather than Radix UI
4343+ </Text>
4444+ </DisclosureTitle>
4545+ <DisclosurePanel>
4646+ <Flex direction="column" gap="6">
4747+ <Body>
4848+ Radix UI paved the way for what we consider a industry cleass
4949+ headless component libarary. However over the years the management
5050+ of the project has fallen through the cracks, most of the team
5151+ left the company after the aquisition, and the remaing team is
5252+ working on a new headless component libarary.
5353+ </Body>
5454+ <Body>
5555+ Given the state of the project, we decided to go for what seems
5656+ like the new gold standard for headless component libararies,
5757+ React Aria. React Aria supports most of the things Radix UI does,
5858+ plus a whole host of other useful component patterns. It truly is
5959+ an accessible primitive layer that most web UI can be built upon.
6060+ </Body>
6161+ </Flex>
6262+ </DisclosurePanel>
6363+ </Disclosure>
6464+ </DisclosureGroup>
6565+ );
6666+}