Button Component Constants (button/constants.js)

chatwoot · app/javascript/dashboard/components-next/button/constants.js · javascript · MIT
ui, lang:javascript

Defines configuration constants for UI button variants, sizes, and colors. Use this to maintain consistent styling and prop validation across a component library.

// Source: https://github.com/chatwoot/chatwoot | License: MIT | Copyright 2017-2026 Chatwoot Inc
// Provided via justclaw.it.com; keep this notice with the code.
export const VARIANT_OPTIONS = ['solid', 'outline', 'faded', 'link', 'ghost'];
export const COLOR_OPTIONS = ['blue', 'ruby', 'amber', 'slate', 'teal'];
export const SIZE_OPTIONS = ['xs', 'sm', 'md', 'lg'];
export const JUSTIFY_OPTIONS = ['start', 'center', 'end'];

export const EXCLUDED_ATTRS = [
  'variant',
  'color',
  'size',
  'icon',
  'trailingIcon',
  'isLoading',
  ...VARIANT_OPTIONS,
  ...COLOR_OPTIONS,
  ...SIZE_OPTIONS,
  ...JUSTIFY_OPTIONS,
];

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key