Use the icon prop to display an icon on the Banner.
The subscription trial has ended. Subscribe to continue using all apps.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24Banner
:icon="RocketIcon"
title="The subscription trial has ended. Subscribe to continue using all apps."
/>
</template>
Use the color prop to change the color of the Banner.
The subscription trial has ended. Subscribe to continue using all apps.
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>
<template>
<B24Banner
color="air-secondary-alert"
:icon="RocketIcon"
title="The subscription trial has ended. Subscribe to continue using all apps."
/>
</template>
Use the close prop to display a Button to dismiss the Banner. Defaults to false.
A close event will be emitted when the close button is clicked.
<template>
<B24Banner id="example" title="The subscription trial has ended. Subscribe to continue using all apps." close />
</template>
When closed, banner-${id} will be stored in the local storage to prevent it from being displayed again. For the example above, banner-example will be stored in the local storage.
To persist the dismissed state across page reloads, you must specify an id prop. Without an explicit id, the banner will only be hidden for the current session and will reappear on page reload.
Use the close-icon prop to customize the close button Icon. Defaults to CrossMIcon.
<script setup lang="ts">
import CircleCrossIcon from '@bitrix24/b24icons-vue/outline/CircleCrossIcon'
</script>
<template>
<B24Banner
title="The subscription trial has ended. Subscribe to continue using all apps."
close
:close-icon="CircleCrossIcon"
/>
</template>
Use the actions prop to add some Button actions to the Banner.
The subscription trial has ended. Subscribe to continue using all apps.
<script setup lang="ts">
import { RocketIcon } from '@bitrix24/b24icons-vue/main/RocketIcon'
import type { ButtonProps } from '@bitrix24/b24ui-nuxt'
const actions = ref<ButtonProps[]>([
{
label: 'Buy a subscription',
color: 'air-primary'
},
{
label: 'Open scanner',
color: 'air-secondary-accent-2'
}
])
</script>
<template>
<B24Banner
title="The subscription trial has ended. Subscribe to continue using all apps."
:actions="actions"
/>
</template>
The action buttons default to color="air-secondary-no-accen" and size="xs". You can customize these values by passing them directly to each action button.
The element or component this component should render as.
id
string
A unique id saved to local storage to remember if the banner has been dismissed.
Without an explicit id, the banner will not be persisted and will reappear on page reload.
icon
IconComponent
The icon displayed next to the title.
title
string
actions
ButtonProps[]
Display a list of actions next to the title.
{ color: 'air-secondary-no-accent', size: 'xs' }
Where to display the linked URL, as the name for a browsing context.
autofocus?: Booleanish
disabled?: boolean
name?: string
type?: "reset" | "submit" | "button"
The type of the button when not a link. Defaults to 'button'.
download?: any
hreflang?: string
media?: string
ping?: string
referrerpolicy?: HTMLAttributeReferrerPolicy
trailingSlash?: "remove" | "append"
An option to either add or remove trailing slashes in the href for this specific link.
Overrides the global trailingSlash option if provided.
active?: boolean
Force the link to be active independent of the current route.
isAction?: boolean
When true, uses special underlined styling.
to
string | kt | Tt
name?: Qt
params?: $
path?: undefined
A relative path to the current location. This property should be removed
query?: mn
hash?: string
force?: boolean
Triggers the navigation even if the location is the same as the current one.
Note this will also add a new entry to the history unless replace: true
is passed.
Matches a string with a regular expression, and returns an array containing the results of that search.
Matches a string or an object that supports being matched against, and returns an array
containing the results of that search, or null if no matches are found.
Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale.
trim: () => string
Removes the leading and trailing white space and line terminator characters from a string.
length: number
Returns the length of a String object.
substr: (from: number, length?: number | undefined) => string
Gets a substring beginning at the specified location and having the specified length.
codePointAt: (pos: number) => number
Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
value of the UTF-16 encoded code point starting at the string element at position pos in
the String resulting from converting this object to a String.
If there is no element at that position, the result is undefined.
If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
includes: (searchString: string, position?: number | undefined) => boolean
Returns true if searchString appears as a substring of the result of converting this
object to a String, at one or more positions that are
greater than or equal to position; otherwise, returns false.
endsWith: (searchString: string, endPosition?: number | undefined) => boolean
Returns true if the sequence of elements of searchString converted to a String is the
same as the corresponding elements of this object (converted to a String) starting at
endPosition – length(this). Otherwise returns false.
Returns the String value result of normalizing the string into the normalization form
named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.
repeat: (count: number) => string
Returns a String value that is made from count copies appended together. If count is 0,
the empty string is returned.
startsWith: (searchString: string, position?: number | undefined) => boolean
Returns true if the sequence of elements of searchString converted to a String is the
same as the corresponding elements of this object (converted to a String) starting at
position. Otherwise returns false.
anchor: (name: string) => string
Returns an <a> HTML anchor element and sets the name attribute to the text value
big: () => string
Returns a <big> HTML element
blink: () => string
Returns a <blink> HTML element
bold: () => string
Returns a <b> HTML element
fixed: () => string
Returns a <tt> HTML element
fontcolor: (color: string) => string
Returns a <font> HTML element and sets the color attribute value
Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
The padding is applied from the start (left) of the current string.
Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
The padding is applied from the end (right) of the current string.
trimEnd: () => string
Removes the trailing white space and line terminator characters from a string.
trimStart: () => string
Removes the leading white space and line terminator characters from a string.
trimLeft: () => string
Removes the leading white space and line terminator characters from a string.
trimRight: () => string
Removes the trailing white space and line terminator characters from a string.