Indicator
v0.0.10
mix mishka.ui.gen.component indicator
Overview of the Phoenix and LiveView Indicator Component
The Mishka Chelekom Indicator component is a Phoenix LiveView component that provides a versatile way to visually highlight specific areas or elements in your application.
Overview of the Phoenix and LiveView Indicator Component
This Phoenix LiveView component allows developers to easily customize the size, color, and position of the indicator. With options for ping animations and various positions around the parent element, you can create dynamic visual cues to enhance the user experience without writing extensive CSS.
Color prop in Phoenix LiveView indicator component
The color prop for the indicator component allows you to choose from a wide range of predefined color options to customize the visual appearance of the indicator. You can select from colors such as base, natural, white, primary, secondary, dark, success, warning, danger, info, silver, misc, and dawn. These colors allow you to seamlessly align the indicator's appearance with the overall design of your application, ensuring a cohesive and visually consistent user interface.
Color prop in Phoenix LiveView indicator component
<.indicator color="base" />
<.indicator color="natural" />
<.indicator color="white" />
<.indicator color="primary" />
<.indicator color="secondary" />
<.indicator color="dark" />
<.indicator color="success" />
<.indicator color="warning" />
<.indicator color="danger" />
<.indicator color="info" />
<.indicator color="silver" />
<.indicator color="misc" />
<.indicator color="dawn" />Pinging prop of Phoenix LiveView indicator component
The pinging prop in the indicator component is a boolean that adds an animated ping effect to the indicator when set to true. By default, the pinging prop is set to false, meaning no animation is applied. When enabled, the pinging effect creates a subtle pulse around the indicator, drawing attention to it and making it ideal for situations where you need to highlight notifications or status updates. This visual cue can help users easily identify important elements on the page without overwhelming the overall design.
Pinging prop of Phoenix LiveView indicator component
<.indicator pinging color="white" />
<.indicator pinging color="primary" />
<.indicator pinging color="secondary" />
<.indicator pinging color="dark" />
<.indicator pinging color="success" />
<.indicator pinging color="warning" />
<.indicator pinging color="danger" />
<.indicator pinging color="info" />
<.indicator pinging color="silver" />
<.indicator pinging color="misc" />
<.indicator pinging color="dawn" />Size prop in Phoenix LiveView indicator component
The size prop for the indicator component provides several options to control the dimensions of the indicator. You can choose from sizes like extra_small, small, medium, large, and extra_large. This flexibility allows you to adjust the indicator's size to suit different use cases, whether it's a small notification dot or a large visual cue to grab attention.
Size prop in Phoenix LiveView indicator component
<.indicator size="extra_small" />
<.indicator size="small" />
<.indicator size="medium" />
<.indicator size="large" />
<.indicator size="extra_large" />Indicator position prop of Phoenix LiveView indicator component
The @indicator_positions prop in the indicator component provides several options for positioning the indicator around its parent element. You can select from the following positions:
top_lefttop_centertop_rightmiddle_leftmiddle_rightbottom_leftbottom_centerbottom_right
This flexibility allows you to place the indicator in the most appropriate location, depending on the design and user interaction, whether you need the visual cue at the top, middle, or bottom of an element.
Indicator position prop of Phoenix LiveView indicator component
<.indicator top_left />
<.indicator top_center />
<.indicator top_right />
<.indicator middle_left />
<.indicator middle_right />
<.indicator bottom_left />
<.indicator bottom_center />
<.indicator bottom_right />Attributes
| Name | Type | Default | Values | Required | Description |
|---|---|---|---|---|---|
id
|
string
| — | — | No | A unique identifier is used to manage state and interaction |
size
|
string
|
small
|
extra_smallsmallmediumlargeextra_large
| No | Determines the overall size of the elements, including padding, font size, and other items |
class
|
any
| — | — | No | Custom CSS class for additional styling |
color
|
string
|
base
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfosilvermiscdawn
| No | Determines color theme |
rest
|
global
| — | — | No | Global attributes can define defaults which are merged with attributes provided by the caller |
Options
Each option takes one or more of its values, separated by commas.
| Option | Values |
|---|---|
--color
|
basenaturalwhiteprimarysecondarydarksuccesswarningdangerinfosilvermiscdawn
|
--size
|
extra_smallsmallmediumlargeextra_large
|
--module
| A module name of your own |
What it generates
mix mishka.ui.gen.component indicator