Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified

Dismissible Card

This is a card component that can be dismissed for a single page load or be hidden via user preference.

How to use

import DismissibleCard from 'calypso/blocks/dismissible-card';

function render() {
    return (
        <div className="your-stuff">
            <DismissibleCard preferenceName="my-unique-preference-name">
                <span>Your stuff in a Card</span>
            </DismissibleCard>
        </div>
    );
}

Props

Below is a list of supported props.

className

TypeString
RequiredNo
Defaultundefined

Any addition classes to pass to the card component.

onClick

TypeFunction
RequiredNo
Defaultlodash/noop

This function will fire when a user clicks on the cross icon

preferenceName

TypeString
RequiredYes
Defaultn/a

The user preference name that we store a boolean against. Note that we prefix this value with 'dismissible-card-' to avoid namespace collisions.

temporary

TypeBoolean
RequiredNo
Defaultundefined

When true, clicking on the cross will dismiss the card for the current page load.