Returnless UI

Color palette

This component is a simple color palette that can be used to display a set of colors for the user to choose from.

Props
modelValue?:
any
Defaults to unknown
colors:
any[]
Defaults to unknown
rows?:
number
Defaults to 2
Events
update:modelValue:
[value: any]

Usage

red
js
<script lang="ts" setup>
import colors from 'tailwindcss/colors';
import { ColorPalette } from '../../src/components'; 
import { ref } from 'vue';

const tailwindColors = Object.entries(colors)
  .filter(([_, color]) => typeof color === 'object')
  .map(([key]) => key);

const color = ref<string | null>('#000000');
</script>

<template>
  <ColorPalette v-model="color" label="Color" :colors="tailwindColors" />
  red
</template>