Skip to content
On this page

Button

The button component is probably the most widely used element in any user interface or website as it can be used to launch an action but also to link to other pages.

Clinux UI provides a large variety of styles and sizes for the button component including outlined buttons, multiple colors, sizes, buttons with icons, and more.

Overview

HTML
<Button [...props] />
typescript
interface UseButtonClassesProps {
  as?: ButtonAsVariant;
  href?: string;
  target?: string;
  to?: string | Record<string, unknown>;
  label?: string | number;
  icon?: string;
  iconRight?: string;
  round?: boolean;
  flat?: boolean;
  rounded?: boolean;
  size?: ButtonSize;
  fab?: boolean;
  fabMini?: boolean;
  padding?: string;
  color?: ButtonDefaultColors;
  textColor?: string;
  noCaps?: boolean;
  noWrap?: boolean;
  tabindex?: number | string;
  loading?: boolean;
  variant?: ButtonVariant;
  loadingNormal?: boolean;
  square?: boolean;
}

Colors

typescript
type ButtonDefaultColors =
  | 'standard'
  | 'primary'
  | 'secondary'
  | 'accent'
  | 'success'
  | 'danger'
  | 'warning'
  | 'info';

defineProps({
  color: {
    type: String as PropType<ButtonDefaultColors>,
    default: 'standard',
  },
});

Outline

typescript
type ButtonVariant = 'default' | 'outline' | 'flat';

defineProps({
  variant: {
    type: String as PropType<ButtonVariant>,
    default: 'default',
  },
});

Square

typescript
defineProps({
  square: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
});

Flat

typescript
type ButtonVariant = 'default' | 'outline' | 'flat';

defineProps({
  variant: {
    type: String as PropType<ButtonVariant>,
    default: 'default',
  },
});

With icon

typescript
defineProps({
  icon: {
    type: String as PropType<string>,
    default: '',
  },
  iconRight: {
    type: String as PropType<string>,
    default: '',
  },
});

Round

typescript
defineProps({
  round: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
});

Rounded

typescript
defineProps({
  rounded: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
});

Custom content

Size

typescript
type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';

defineProps({
  size: {
    type: String as PropType<ButtonSize>,
    default: 'md',
  },
});

Padding

typescript
defineProps({
  padding: {
    type: String as PropType<string>,
    default: '',
  },
});

Progress

typescript
defineProps({
  loading: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
  loadingNormal: {
    type: Boolean as PropType<boolean>,
    default: false,
  },
});

Slot options

Action button

Clinux UI - Released under the MIT License.