> For the complete documentation index, see [llms.txt](https://olga-f.gitbook.io/react/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olga-f.gitbook.io/react/design-systems/theme-ui.md).

# Theme UI

> [Theme UI](https://theme-ui.com/getting-started) combines several libraries together to form a mini-framework for styling applications.

> Theme UI is built with:
>
> * [Emotion](https://emotion.sh/docs/introduction): used to generate isolated CSS with theming context
> * [MDX](https://mdxjs.com/): used to provide custom Emotion styled components to MDX documents, without polluting the global CSS scope
> * [Typography.js](https://github.com/KyleAMathews/typography.js): optionally used for creating rich typographic styles with a simple, high-level API

Theme UI includes an optional presets package that can be used as examples or as a starting point for extending your own themes.

```
npm i theme-ui @theme-ui/presets
```

Make a file `theme.js`  on the root of your app. To view an example of the built-in presets, see the [Demo](https://theme-ui.com/demo).

`theme.js` uses a preset theme "*bulma*" with some extras:

```jsx
import { bulma } from '@theme-ui/presets'

const theme = {
  ...bulma,
  containers: {
    card: {
      boxShadow: '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)',
      border: '1px solid',
      borderColor: 'muted',
      borderRadius: '4px',
      p: 2,
    },
    page: {
      width: '100%',
      maxWidth: '960px',
      m: 0,
      mx: 'auto',
    }
  },
  styles: {
    ...bulma.styles
  }
}

export default theme
```

```jsx
import React from 'react'
import {ThemeProvider} from 'theme-ui'
import theme from '../theme'

function App({ Component, pageProps }) {
  return(
    <ThemeProvider theme={theme}> 
    <Component {...pageProps} />
    </ThemeProvider>
  )
}

export default App
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://olga-f.gitbook.io/react/design-systems/theme-ui.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
