Marigold
Marigold

Application

MarigoldProvider
RouterProvider

Layout

AppLayoutbeta
Aside
Aspect
Breakout
Center
Columns
Container
Grid
Inline
Inset
Scrollable
Split
Stack
Tiles

Actions

ActionBaralpha
Button
Link
LinkButton
ToggleButtonbeta

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
FileField
Form
Multiselectdeprecated
NumberField
Radio
SearchField
Select
Slider
Switch
TagFieldbeta
TextArea
TextField
TimeField

Collection

SelectList
Table
Tag

Navigation

Accordion
Breadcrumbsupdated
Pagination
Sidebarbeta
Tabsupdated
TopNavigationbeta

Overlay

ContextualHelp
Dialog
Drawer
Menu
Toastbeta
Tooltip

Content

Badge
Card
Divider
EmptyStatebeta
Headline
Icon
List
Loader
SectionMessage
SVG
Text

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useListData
useResponsiveValue
useTheme
VisuallyHidden
Components

useTheme

Hook that applies a theme

The useTheme is a hook that gets you the current theme and all of its attributes and properties.

The useTheme hook returns the current theme, if there isn't a theme it uses the defaultTheme

const theme = useTheme();

Import

To import the hook you just have to use this code below.

import { useTheme } from '@marigold/system';

Examples

Get all the Theme Properties

Here is an example which shows you the chosen theme from the theme switcher on the top of the page. With the useTheme hook you can get the particular values for the available properties.

    name
  • 0
  • 1
  • 2
    components
  • Accordion
  • ActionBar
  • Autocomplete
  • Badge
  • Breadcrumbs
  • Button
  • Calendar
  • Card
  • Checkbox
  • CloseButton
  • Collapsible
  • ComboBox
  • ContextualHelp
  • DateField
  • DatePicker
  • Dialog
  • Divider
  • Drawer
  • EmptyState
  • Field
  • FileField
  • Headline
  • HelpText
  • IconButton
  • Input
  • Label
  • LegacyTable
  • Link
  • List
  • ListBox
  • Loader
  • Menu
  • Modal
  • MultiSelect
  • NumberField
  • Pagination
  • Popover
  • ProgressCircle
  • Radio
  • SectionMessage
  • Select
  • Sidebar
  • Slider
  • Switch
  • Table
  • Tabs
  • Tag
  • TagField
  • Text
  • TextArea
  • Toast
  • ToggleButton
  • Tooltip
  • TopNavigation
  • Tray
  • Underlay
import { List } from '@marigold/components';import { ThemeProvider, useTheme } from '@marigold/system';export default () => {  const theme = useTheme();  return (    <ThemeProvider theme={theme}>      <div className="w-full overflow-auto">        {Object.entries(theme).map(([key, value]) => (          <List key={key}>            <strong>{key}</strong>            {Object.keys(value).map(item => (              <List.Item key={crypto.randomUUID()}>                {item}                <br />              </List.Item>            ))}          </List>        ))}      </div>    </ThemeProvider>  );};
Last update: a month ago

useResponsiveValue

Hook that returns values based on screen sizes.

VisuallyHidden

Hide children but keep content accessible

On this page

ImportExamplesGet all the Theme Properties