Popover
Popover component pack for Seed
Install
npm install seed-popover --save
Dependencies
Bootstrap
Javascript
This component’s interactions are powered by Bootstrap. Refer to their popover documentation for Javascript usage.
CSS
This component does not require any of Bootstrap’s CSS for style. In fact, it is recommended that Bootstrap’s CSS are omitted for seed-popover
to be styled properly.
Class names
In the markup examples (below), you will that class names don’t follow the ITCSS naming scheme. This is because Boostrap requires specific class names for their popover components.
Example
Four options are available: top, right, bottom, and left aligned.
<button type="button" class="c-button" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on left
</button>
<button type="button" class="c-button" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on top
</button>
<button type="button" class="c-button" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus
sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on bottom
</button>
<button type="button" class="c-button" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on right
</button>
Configurations
Below are the default Sass configuration variables for seed-popover. The variables can be found in the pack’s _config.scss
file.
seed-popover/_config.scss
// Namespaces
$seed-popover-namespace: "popover" !default;
$seed-popover-arrow-namespace: "arrow" !default;
$seed-popover-content-namespace: "popover-content" !default;
$seed-popover-title-namespace: "popover-title" !default;
// Config: Popover
$seed-popover-background-color: white !default;
$seed-popover-border-color: rgba(black, 0.2) !default;
$seed-popover-border-radius: 4px !default;
$seed-popover-box-shadow: none !default;
$seed-popover-max-width: 280px !default;
$seed-popover-z-index: 1060 !default;
// Config: Arrow
$seed-popover-arrow-size: 10px !default;
$seed-popover-arrow-outer-size: $seed-popover-arrow-size + 1px !default;
// Config: Content
$seed-popover-content-padding: 8px 12px !default;