Bootstrap components written in pure AngularJS by the AngularUI Team. For more info please check the official site
The body of the accordion group grows to fit the contents
The accordion directive builds on top of the collapse directive to provide a list of items, with collapsible bodies that are collapsed or expanded by clicking on the item's header.
We can control whether expanding an item will cause the other items to close, using the close-others
attribute on accordion.
The body of each accordion group is transcluded in to the body of the collapsible element.
Alert is an AngularJS-version of bootstrap's alert.
This directive can be used to generate alerts from the dynamic model data (using the ng-repeat directive);
The presence of the "close" attribute determines if a close button is displayed
{{singleModel}}
{{checkModel}}
{{radioModel || 'null'}}
There are two directives that can make a group of buttons behave like a set of checkboxes, radio buttons, or a hybrid where radio buttons can be unchecked.
Select a tab by setting active binding to true:
AngularJS version of the tabs directive.
<tabset>
vertical
(Defaults: false) :
Whether tabs appear vertically stacked.
justified
(Defaults: false) :
Whether tabs fill the container and have a consistent width.
type
(Defaults: 'tabs') :
Navigation type. Possible values are 'tabs' and 'pills'.
<tab>
heading
or <tab-heading>
:
Heading text or HTML markup.
active
(Defaults: false) :
Whether tab is currently selected.
disabled
(Defaults: false) :
Whether tab is clickable and can be activated.
select()
(Defaults: null) :
An optional expression called when tab is activated.
deselect()
(Defaults: null) :
An optional expression called when tab is deactivated.
Carousel creates a carousel similar to bootstrap's image carousel.
The carousel also offers support for touchscreen devices in the form of swiping. To enable swiping, load the ngTouch
module as a dependency.
Use a <carousel>
element with <slide>
elements inside it. It will automatically cycle through the slides at a given rate, and a current-index variable will be kept in sync with the currently visible slide.
AngularJS version of Bootstrap's collapse plugin. Provides a simple way to hide and show an element with a css transition.
Selected date is: {{dt | date:'fullDate' }}
A clean, flexible, and fully customizable date picker.
User can navigate through months and years. The datepicker shows dates that come from other than the main month being displayed. These other dates are also selectable.
Everything is formatted using the date filter and thus is also localized.
All settings can be provided as attributes in the datepicker
or globally configured through the datepickerConfig
.
ng-model
:
The date object.
datepicker-mode
(Defaults: 'day') :
Current mode of the datepicker (day|month|year). Can be used to initialize datepicker to specific mode.
min-date
(Default: null) :
Defines the minimum available date.
max-date
(Default: null) :
Defines the maximum available date.
date-disabled (date, mode)
(Default: null) :
An optional expression to disable visible options based on passing date and current mode (day|month|year).
show-weeks
(Defaults: true) :
Whether to display week numbers.
starting-day
(Defaults: 0) :
Starting day of the week from 0-6 (0=Sunday, ..., 6=Saturday).
init-date
:
The initial date view when no model value is not specified.
min-mode
(Defaults: 'day') :
Set a lower limit for mode.
max-mode
(Defaults: 'year') :
Set an upper limit for mode.
format-day
(Default: 'dd') :
Format of day in month.
format-month
(Default: 'MMMM') :
Format of month in year.
format-year
(Default: 'yyyy') :
Format of year in year range.
format-day-header
(Default: 'EEE') :
Format of day in week header.
format-day-title
(Default: 'MMMM yyyy') :
Format of title when selecting day.
format-month-title
(Default: 'yyyy') :
Format of title when selecting month.
year-range
(Default: 20) :
Number of years displayed in year selection.
Options for datepicker can be passed as JSON using the datepicker-options
attribute.
Specific settings for the datepicker-popup
, that can globally configured through the datepickerPopupConfig
, are:
datepicker-popup
(Default: 'yyyy-MM-dd') :
The format for displayed dates.
show-button-bar
(Default: true) :
Whether to display a button bar underneath the datepicker.
current-text
(Default: 'Today') :
The text to display for the current day button.
clear-text
(Default: 'Clear') :
The text to display for the clear button.
close-text
(Default: 'Done') :
The text to display for the close button.
close-on-date-selection
(Default: true) :
Whether to close calendar when a date is chosen.
datepicker-append-to-body
(Default: false):
Append the datepicker popup element to body
, rather than inserting after datepicker-popup
. For global configuration, use datepickerPopupConfig.appendToBody
.
Depending on datepicker's current mode, the date may reffer either to day, month or year. Accordingly, the term view reffers either to a month, year or year range.
Left
: Move focus to the previous date. Will move to the last date of the previous view, if the current date is the first date of a view.Right
: Move focus to the next date. Will move to the first date of the following view, if the current date is the last date of a view.Up
: Move focus to the same column of the previous row. Will wrap to the appropriate row in the previous view.Down
: Move focus to the same column of the following row. Will wrap to the appropriate row in the following view.PgUp
: Move focus to the same date of the previous view. If that date does not exist, focus is placed on the last date of the month.PgDn
: Move focus to the same date of the following view. If that date does not exist, focus is placed on the last date of the month.Home
: Move to the first date of the view.End
: Move to the last date of the view.Enter
/Space
: Select date.Ctrl
+Up
: Move to an upper mode.Ctrl
+Down
: Move to a lower mode.Esc
: Will close popup, and move focus to the input.Time is: {{mytime | date:'shortTime' }}
A lightweight & configurable timepicker directive.
All settings can be provided as attributes in the <timepicker>
or globally configured through the timepickerConfig
.
ng-model
:
The Date object that provides the time state.
hour-step
(Defaults: 1) :
Number of hours to increase or decrease when using a button.
minute-step
(Defaults: 1) :
Number of minutes to increase or decrease when using a button.
show-meridian
(Defaults: true) :
Whether to display 12H or 24H mode.
meridians
(Defaults: null) :
Meridian labels based on locale. To override you must supply an array like ['AM', 'PM'].
readonly-input
(Defaults: false) :
Whether user can type inside the hours & minutes input.
mousewheel
(Defaults: true) :
Whether user can scroll inside the hours & minutes input to increase or decrease it's values.
Dropdown is a simple directive which will toggle a dropdown menu on click or programmatically.
You can either use is-open
to toggle or add inside a <a dropdown-toggle>
element to toggle it when is clicked.
There is also the on-toggle(open)
optional expression fired when dropdown changes state.
$modal
is a service to quickly create AngularJS-powered modal windows.
Creating custom modals is straightforward: create a partial view, its controller and reference them when using the service.
The $modal
service has only one method: open(options)
where available options are like follows:
templateUrl
- a path to a template representing modal's contenttemplate
- inline template representing the modal's contentscope
- a scope instance to be used for the modal's content (actually the $modal
service is going to create a child scope of a provided scope). Defaults to $rootScope
controller
- a controller for a modal instance - it can initialize scope used by modal. Accepts the "controller-as" syntax in the form 'SomeCtrl as myctrl'; can be injected with $modalInstance
controllerAs
- an alternative to the controller-as syntax, matching the API of directive definitions. Requires the controller
option to be provided as wellresolve
- members that will be resolved and passed to the controller as locals; it is equivalent of the resolve
property for AngularJS routesbackdrop
- controls presence of a backdrop. Allowed values: true (default), false (no backdrop), 'static'
- backdrop is present but modal window is not closed when clicking outside of the modal window.keyboard
- indicates whether the dialog should be closable by hitting the ESC key, defaults to truebackdropClass
- additional CSS class(es) to be added to a modal backdrop templatewindowClass
- additional CSS class(es) to be added to a modal window templatewindowTemplateUrl
- a path to a template overriding modal's window templatesize
- optional size of modal window. Allowed values: 'sm'
(small) or 'lg'
(large). Requires Bootstrap 3.1.0 or laterThe open
method returns a modal instance, an object with the following properties:
close(result)
- a method that can be used to close a modal, passing a resultdismiss(reason)
- a method that can be used to dismiss a modal, passing a reasonresult
- a promise that is resolved when a modal is closed and rejected when a modal is dismissedopened
- a promise that is resolved when a modal gets opened after downloading content's template and resolving all variablesIn addition the scope associated with modal's content is augmented with 2 methods:
$close(result)
$dismiss(reason)
Those methods make it easy to close a modal window without a need to create a dedicated controller.
The selected page no: {{currentPage}}
Page: {{bigCurrentPage}} / {{numPages}}
A lightweight pagination directive that is focused on ... providing pagination & will take care of visualising a pagination bar and enable / disable buttons correctly!
Settings can be provided as attributes in the <pagination>
or globally configured through the paginationConfig
.
ng-model
:
Current page number. First page is 1.
total-items
:
Total number of items in all pages.
items-per-page
(Defaults: 10) :
Maximum number of items per page. A value less than one indicates all items on one page.
max-size
(Defaults: null) :
Limit number for pagination size.
num-pages
readonly
(Defaults: angular.noop) :
An optional expression assigned the total number of pages to display.
rotate
(Defaults: true) :
Whether to keep current page in the middle of the visible ones.
direction-links
(Default: true) :
Whether to display Previous / Next buttons.
previous-text
(Default: 'Previous') :
Text for Previous button.
next-text
(Default: 'Next') :
Text for Next button.
boundary-links
(Default: false) :
Whether to display First / Last buttons.
first-text
(Default: 'First') :
Text for First button.
last-text
(Default: 'Last') :
Text for Last button.
Settings can be provided as attributes in the <pager>
or globally configured through the pagerConfig
.
For ng-model
, total-items
, items-per-page
and num-pages
see pagination settings. Other settings are:
align
(Default: true) :
Whether to align each link to the sides.
previous-text
(Default: '« Previous') :
Text for Previous button.
next-text
(Default: 'Next »') :
Text for Next button.
A lightweight, extensible directive for fancy popover creation. The popover directive supports multiple placements, optional transition animation, and more.
Like the Bootstrap jQuery plugin, the popover requires the tooltip module.
The popover directives provides several optional attributes to control how it will display:
popover-title
: A string to display as a fancy title.popover-placement
: Where to place it? Defaults to "top", but also accepts
"bottom", "left", "right".popover-animation
: Should it fade in and out? Defaults to "true".popover-popup-delay
: For how long should the user have to have the mouse
over the element before the popover shows (in milliseconds)? Defaults to 0.popover-trigger
: What should trigger the show of the popover? See the
tooltip
directive for supported values.popover-append-to-body
: Should the tooltip be appended to $body
instead of
the parent element?The popover directives require the $position
service.
The popover directive also supports various default configurations through the $tooltipProvider. See the tooltip section for more information.
Pellentesque {{dynamicTooltipText}}, sit amet venenatis urna cursus eget nunc scelerisque viverra mauris, in aliquam. Tincidunt lobortis feugiat vivamus at left eget arcu dictum varius duis at consectetur lorem. Vitae elementum curabitur right nunc sed velit dignissim sodales ut eu sem integer vitae. Turpis egestas bottom pharetra convallis posuere morbi leo urna, fading at elementum eu, facilisis sed odio morbi quis commodo odio. In cursus delayed turpis massa tincidunt dui ut.
I can even contain HTML. Check me out!
A lightweight, extensible directive for fancy tooltip creation. The tooltip directive supports multiple placements, optional transition animation, and more.
There are two versions of the tooltip: tooltip
and tooltip-html-unsafe
. The
former takes text only and will escape any HTML provided. The latter takes
whatever HTML is provided and displays it in a tooltip; it called "unsafe"
because the HTML is not sanitized. The user is responsible for ensuring the
content is safe to put into the DOM!
The tooltip directives provide several optional attributes to control how they will display:
tooltip-placement
: Where to place it? Defaults to "top", but also accepts
"bottom", "left", "right".tooltip-animation
: Should it fade in and out? Defaults to "true".tooltip-popup-delay
: For how long should the user have to have the mouse
over the element before the tooltip shows (in milliseconds)? Defaults to 0.tooltip-trigger
: What should trigger a show of the tooltip?tooltip-append-to-body
: Should the tooltip be appended to $body
instead of
the parent element?The tooltip directives require the $position
service.
Triggers
The following show triggers are supported out of the box, along with their provided hide triggers:
mouseenter
: mouseleave
click
: click
focus
: blur
For any non-supported value, the trigger will be used to both show and hide the tooltip.
$tooltipProvider
Through the $tooltipProvider
, you can change the way tooltips and popovers
behave by default; the attributes above always take precedence. The following
methods are available:
setTriggers( obj )
: Extends the default trigger mappings mentioned above
with mappings of your own. E.g. { 'openTrigger': 'closeTrigger' }
.options( obj )
: Provide a set of defaults for certain tooltip and popover
attributes. Currently supports 'placement', 'animation', 'popupDelay', and
appendToBody
. Here are the defaults: placement: 'top'
, animation: true
, popupDelay: 0
& appendToBody: false
A progress bar directive that is focused on providing feedback on the progress of a workflow or action.
It supports multiple (stacked) bars into the same <progress>
element or a single <progressbar>
elemtnt with optional max
attribute and transition animations.
<progressbar>
value
:
The current value of progress completed.
type
(Default: null) :
Style type. Possible values are 'success', 'warning' etc.
max
(Default: 100) :
A number that specifies the total value of bars that is required.
animate
(Default: true) :
Whether bars use transitions to achieve the width change.
Place multiple <bars>
into the same <progress>
element to stack them.
<progress>
supports max
and animate
& <bar>
supports value
and type
attributes.
Model: {{selected | json}}
Model: {{asyncSelected | json}}
Model: {{customSelected | json}}
Typeahead is a AngularJS version of Bootstrap v2's typeahead plugin. This directive can be used to quickly create elegant typeaheads with any form text input.
It is very well integrated into AngularJS as it uses a subset of the select directive syntax, which is very flexible. Supported expressions are:
The sourceArray
expression can use a special $viewValue
variable that corresponds to the value entered inside the input.
This directive works with promises, meaning you can retrieve matches using the $http
service with minimal effort.
The typeahead directives provide several attributes:
ng-model
:
Assignable angular expression to data-bind to
typeahead
:
Comprehension Angular expression (see select directive)
typeahead-append-to-body
(Defaults: false) : Should the typeahead popup be appended to $body instead of the parent element?
typeahead-editable
(Defaults: true) :
Should it restrict model values to the ones selected from the popup only ?
typeahead-input-formatter
(Defaults: undefined) :
Format the ng-model result after selection
typeahead-loading
(Defaults: angular.noop) :
Binding to a variable that indicates if matches are being retrieved asynchronously
typeahead-min-length
(Defaults: 1) :
Minimal no of characters that needs to be entered before typeahead kicks-in
typeahead-on-select($item, $model, $label)
(Defaults: null) :
A callback executed when a match is selected
typeahead-template-url
:
Set custom item template
typeahead-wait-ms
(Defaults: 0) :
Minimal wait time after last character typed before typeahead kicks-in
Rate: {{rate}} - Readonly is: {{isReadonly}} - Hovering over: {{overStar || "none"}}
Rating directive that will take care of visualising a star rating bar.
<rating>
ng-model
:
The current rate.
max
(Defaults: 5) :
Changes the number of icons.
readonly
(Defaults: false) :
Prevent user's interaction.
on-hover(value)
:
An optional expression called when user's mouse is over a particular icon.
on-leave()
:
An optional expression called when user's mouse leaves the control altogether.
state-on
(Defaults: null) :
A variable used in template to specify the state (class, src, etc) for selected icons.
state-off
(Defaults: null) :
A variable used in template to specify the state for unselected icons.
rating-states
(Defaults: null) :
An array of objects defining properties for all icons. In default template, stateOn
& stateOff
property is used to specify the icon's class.