Methods
Creates a button widget with the specified properties.
Parameters:
Name
Type
Description
props
Object
Properties
Name
Type
Attributes
Description
position
string
The position of the button. The position is always 'fixed' in CSS, but this parameter allows you to specify offsets from left
, right
, top
and bottom
.
onClick
string
The callback to be invoked when the button is clicked. The button instance is passed as a parameter to the callback.
icon
string
<optional>
The name of any FontAwesome icon. Defaults to no icon.
text
string
<optional>
The text to be shown on the button. Defaults to no text. If there is no text then the button will be circular.
style
string
<optional>
The style of the button: 'primary', 'success', 'danger' or 'default'.
This affects the button colour.
size
string
<optional>
The size of the button: 'default' or 'large'.
id
string
<optional>
This allows you to specify the CSS id
of the button, but this shouldn't ordinarily be required.
Source:
$BSD.overlay.button({
position: { top: '20px', right: '20px' },
icon: 'arrow-left',
onClick: () => console.log('clicked 1'),
});
Returns:
container(props)
Creates a container widget with the specified properties.
Parameters:
Name
Type
Description
props
Object
Properties
Name
Type
Description
position
string
The position of the container. The position is always 'fixed' in CSS, but this parameter allows you to specify offsets from left
, right
, top
and bottom
.
layout
string
The layout of the container: 'row' or 'column'.
Source:
Example
const c = $BSD.overlay.container({ position: { bottom: '20px', right: '20px' } });
c.button({ icon: 'chevron-left', onClick: goLeft });
c.button({ icon: 'chevron-right', onClick: goRight });
Returns: