To display an HTML block <div> filled with a specific color, you can use the Color component.
make(public string|ColorEnum $color)
make(publicstring|ColorEnum $color)
make(public string|ColorEnum $color)
use MoonShine\Support\Enums\Color as ColorEnum;use MoonShine\UI\Components\Color;Color::make(color: ColorEnum::PURPLE)
useMoonShine\Support\Enums\ColorasColorEnum;
useMoonShine\UI\Components\Color;
Color::make(color: ColorEnum::PURPLE)
use MoonShine\Support\Enums\Color as ColorEnum;use MoonShine\UI\Components\Color;Color::make(color: ColorEnum::PURPLE)
<x-moonshine::color:color="'red'"/>
<x-moonshine::color :color="'red'"/>
Available values in the enum MoonShine\Support\Enums\Color:
enum Color: string
{
case PRIMARY = 'primary';
case SECONDARY = 'secondary';
case SUCCESS = 'success';
case ERROR = 'error';
case WARNING = 'warning';
case INFO = 'info';
case PURPLE = 'purple';
case PINK = 'pink';
case BLUE = 'blue';
case GREEN = 'green';
case YELLOW = 'yellow';
case RED = 'red';
case GRAY = 'gray';
}
enumColor: string
{
casePRIMARY='primary';
caseSECONDARY='secondary';
caseSUCCESS='success';
caseERROR='error';
caseWARNING='warning';
caseINFO='info';
casePURPLE='purple';
casePINK='pink';
caseBLUE='blue';
caseGREEN='green';
caseYELLOW='yellow';
caseRED='red';
caseGRAY='gray';
}
enum Color: string
{
case PRIMARY = 'primary';
case SECONDARY = 'secondary';
case SUCCESS = 'success';
case ERROR = 'error';
case WARNING = 'warning';
case INFO = 'info';
case PURPLE = 'purple';
case PINK = 'pink';
case BLUE = 'blue';
case GREEN = 'green';
case YELLOW = 'yellow';
case RED = 'red';
case GRAY = 'gray';
}