You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<EuiBeacon> would be more useful if it had a color property #6315
In the EUI documentation, the EuiBeacon component is defined to be used as "...to draw visual attention to a specific location or element."
The current component displays with a slowly blinking icon in the green color.
This component would likely be more useful if it had a color property that could default to 'green' for backwards compatibility but also allow the user of the component to set a different color (e.g., 'warning', etc) in different UI contexts.
Fully acknowledging that a developer can use css (e.g., style={{ backgroundColor: 'red' }} to accomplish the same effect. But for consistency across the EUI framework, a formal 'color' property would IMO fit better.
exportconstCOLORS=['primary','subdued','success','accent','danger','warning',]asconst;exporttypeBeaconColor=typeofCOLORS[number];exporttypeEuiBeaconProps=Omit<HTMLAttributes<HTMLDivElement>,'children'>&CommonProps&{/** * Height and width of the center circle. Value is passed directly to the `style` attribute */size?: number|string;/** * Any of the named color palette options. */color?: BeaconColor;};
Do you think it should only accept named colors as a prop like shown in the code above or any color string as well (Hex, RGB...)?
Fabulous :) thanks for this enhancement gang! Agree that the named colors is most appropriate as it constrains the choices to those of the theme. Going outside that list could/should involve going the 'extra step' and using CSS.
@miukimiu Sorry for the slow response. I've been busy lately and was stuck with a documentation issue. I'll describe the issue in the PR and need your help on it.
Activity
qpointsystems commentedon Oct 17, 2022
Fully acknowledging that a developer can use css (e.g., style={{ backgroundColor: 'red' }} to accomplish the same effect. But for consistency across the EUI framework, a formal 'color' property would IMO fit better.
dawitamene commentedon Oct 28, 2022
@miukimiu Hi! I would like to work on this one, could you please assign this to me?
elizabetdev commentedon Nov 3, 2022
Thanks, @dawitam11. Let me know if you need help implementing it.
dawitamene commentedon Nov 6, 2022
@miukimiu Thank you!
Do you think it should only accept named colors as a prop like shown in the code above or any color string as well (Hex, RGB...)?
elizabetdev commentedon Nov 7, 2022
Hi @dawitam11.
Just the named colors as you suggested would work. 👍🏽
The type can be called
EuiBeaconColorinstead ofBeaconColor.qpointsystems commentedon Nov 7, 2022
Fabulous :) thanks for this enhancement gang! Agree that the named colors is most appropriate as it constrains the choices to those of the theme. Going outside that list could/should involve going the 'extra step' and using CSS.
dawitamene commentedon Nov 21, 2022
@miukimiu Sorry for the slow response. I've been busy lately and was stuck with a documentation issue. I'll describe the issue in the PR and need your help on it.