selectors {linne} | R Documentation |
Selectors
Description
Create selectors to select particular elements.
Usage
sel_id(value)
sel_input(value)
sel_all()
sel_class(value)
sel_tag(value)
sel_attr(attribute, value = NULL, tag = NULL)
Arguments
value |
Value of selector. |
attribute |
Name of attribute. |
tag |
Name of tag. |
Details
The functions will print in the console the CSS selector they compose.
Functions
-
sel_id()
- Select an object by its id, e.g.:sel_id('btn')
selectsshiny::actionButton('btn', 'Button')
. -
sel_all()
- Selects everything. -
sel_input()
- Selects an input by its id, e.g.:sel_id('txt')
selectsshiny::textInput('txt', 'Text')
. -
sel_class()
- Select all elements bearing a specific class, e.g.:sel_class('cls')
, selectsshiny::h1('hello', class = 'cls')
. -
sel_tag()
- Select all tags, e.g.:sel_tag('p')
selectsp('hello')
. -
sel_attr()
- Select all tags with a specific attribute.
See Also
%with%
, %or%
, and %child%
as well as
when_active()
, when_hover()
, and when_focus()
for more sophisticated element selection.
Examples
# select element where id = x
sel_id("x")
# select all elements with class = "container"
sel_class("container")