Skip to content

Is it possible to update component sizes globally? #378

Answered by cschroeter
t-rosa asked this question in Q&A
Discussion options

You must be logged in to vote

in ~/components/ui/primitives/input.tsx

import { ark } from '@ark-ui/react/factory'
import { styled } from 'styled-system/jsx'
import { input } from 'styled-system/recipes'
import type { ComponentProps } from 'styled-system/types'

export type InputProps = ComponentProps<typeof Input>
export const Input = styled(ark.input, input, { defaultProps: { size: 'sm' } })

Or as an alternative in panda.config.ts

import { defineConfig } from '@pandacss/dev'

export default defineConfig({
  // ...
  theme: {
    extend: {
      recipes: {
        input: {
          defaultVariants: {
            size: 'sm',
          },
        },
      },
    },
  },
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@t-rosa
Comment options

Answer selected by t-rosa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants