Flag

Flags are the primary method for providing system feedback in the product’s user interface. Messages include notifications of various kinds: alerts, confirmations, notices, warnings, info, and errors.

For visual examples of each flag, see the Design guide.

Example

1
2
var flag = AP.flag.create({
  title: 'Successfully created a flag.',
  body: 'This is a flag.',
  type: 'success',
  actions: {
    'actionkey': 'Click me'
  }
});

Methods

create (options)

Creates a new flag.

Parameters

NameTypeDescription
optionsObject

Options of the flag.

Properties
NameTypeDefaultDescription
titleString

The title text of the flag.

bodyString

The body text of the flag.

typeStringinfo

Sets the type of the message. Valid options are "info", "success", "warning" and "error".

closeString

The closing behavior for this flag. Valid options are "manual", and "auto".

actionsObject

Map of {actionIdentifier: 'Action link text'} to add to the flag. The actionIdentifier will be passed to a 'flag.action' event if the link is clicked.

Returns: Flag~Flag

Methods

close ()

Closes the flag.

Example

1
2
var flag = AP.flag.create({
  title: 'Successfully created a flag.',
  body: 'This is a flag.',
  type: 'info'
});

// Close the flag.
flag.close()

Rate this page: