Skip to content

[EuiCallOut] Add optional close button #7038

Closed

Description

@ryankeairns

Is your feature request related to a problem? Please describe.
In practice, callouts can be dismissed or closed. The current docs demonstrate the use of a 'Dismiss' button below the copy and, in Kibana, we see the use of a close button in the upper-right corner (see below).

CleanShot 2023-08-03 at 07 10 41@2x

Describe the solution you'd like
It is possible for implementors to attain this layout/functionality, but it is not provided out of the box. A recent question was raised with the EUI team on how to do this, and the team felt it was worthwhile to 'pave the cowpath' and add an optional close button as opposed to leaving it up to a documented pattern.

Describe alternatives you've considered
Leaving it up to a documented pattern.

Additional context
With a fresh deployment (or by clearing localStorage) you can see the above example in Discover, as an example.

### Tasks
- [ ] https://github.com/elastic/eui/pull/7156

Activity

  1. kyrspl commented on Aug 14, 2023

    @kyrspl
    Contributor

    @ryankeairns, my thoughts below:

    Dismissible prop
    We could add a dismissible: bool prop, which adds the Dismiss button as well as a close icon (top right).

    Screenshot 2023-08-14 at 10 40 13

    :: CTA

    When Dismiss is the only option, should the button be a primary, secondary or tertiary action?
    Screenshot 2023-08-14 at 16 26 02

    :: Text
    Should we fix the text to Dismiss?

    :: Other, similar requests
    Another request that has come in other areas of product (namely Userconsole) is a Don't show again action.

  2. ryankeairns commented on Aug 14, 2023

    @ryankeairns
    ContributorAuthor

    Thanks for noodling on this @kyrspl

    In a constructive way, this walks the line of being either just-enough or too opinionated. Conservatively, I start with the latter, but I can't think of a situation where you wouldn't want to have both. Going the route of showing both, I am leaning toward the last option (the default button style) for the Dismiss button when it is the only CTA; else use the empty style.

  3. kyrspl commented on Sep 6, 2023

    @kyrspl
    Contributor

    Following discussions related to the work in #7156, we decided to provide an isDismissible prop, which when true renders a close icon to the top right.

    @ryankeairns, we could add guidelines on how to render the Dismiss button (secondary vsempty) and leave the implementation details to the teams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions