HeroSection
Create a full-width introduction with a cover image, readable text and room for your main action.
Live TypeScript example
Try the component here, then use the source below in your application.
- JavaScript
- 2.6 KiB
- Component CSS
- 1.3 KiB
- Shared theme CSS
- 3.8 KiBonce per application
How sizes are measured
The JavaScript figure includes this component’s required helpers. CSS includes its styling dependencies. Each entry is bundled separately for ES2022, minified, then compressed with gzip level 9. Your bundler may share helpers across components. Images, fonts, examples and application code are excluded.
Before compression: JavaScript 5.9 KiB; component CSS 3.9 KiB. These figures describe browser assets, not the complete package download.
View all component measurements →Use a single page-level H1. Choose overlay strength and image crop that preserve readable contrast. Supply alt text only when the background image communicates content.
import '@blukavantui/web/theme.css'
import {buttonElement} from '@blukavantui/web/button';
import {createHeroSection} from '@blukavantui/web/hero-section';
import '@blukavantui/web/button.css';
import '@blukavantui/web/hero-section.css';
export function mount(host:HTMLElement) {
const owned:{destroy():void}[]=[];
const keep=<T extends {destroy():void}>(c:T)=>{owned.push(c);return c;};
const actions=document.createElement("div");const button=buttonElement({Label:"Explore the collection",Color:"Primary"},{Click:()=>{status.textContent="Connect this action to your application route.";}});actions.append(button);
const status=document.createElement("p");status.setAttribute("role","status");
keep(createHeroSection(host,{
"ImageUrl": "https://blukavantui.blutekmedia.com/bluui/rich/studio.jpg",
"ImageDescription": "A warm contemporary interior with natural light",
"FocalPoint": "50% 50%",
"Eyebrow": "Independent creative studio",
"Title": "Ideas made extraordinary.",
"Description": "We bring brands, spaces and digital experiences to life. Thoughtfully made. Built to last.",
"MinHeight": 560,
"OverlayOpacity": 55,
"Alignment": "Left",
"VerticalAlignment": "Center",
"HeadingLevel": 1,
"ContentWidth": "Wide"
,Actions:actions},{Error: (message) => {status.textContent="Error: "+String(message);}}));host.append(status);
return {destroy(){owned.reverse().forEach(c=>c.destroy());status.remove();}};
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()
Install the library and add the host element
npm install https://blukavantui.blutekmedia.com/downloads/blukavantui-web-0.6.0.tgz<div id="example"></div>This example uses the downloadable @blukavantui/web package. Your application handles persistence and authentication through its typed callbacks. The starter ZIP includes this same example.
createHeroSection
Pass options as the second argument and callbacks in the third argument. Keep the returned instance to update options or dispose it when its view is removed.
import { createHeroSection } from '@blukavantui/web/hero-section';
import '@blukavantui/web/hero-section.css';Load @blukavantui/web/theme.css once in your app shell.createHeroSection(host: HTMLElement, options: T.HeroSectionOptions, events?: T.HeroSectionEvents)Reference for @blukavantui/web 0.6.0. Required and optional follow the shipped TypeScript declarations; optional does not imply a particular default. Pass typed arrays and objects directly where shown.
Options
17| Name | Type / requirement | Usage |
|---|---|---|
ImageUrl | stringOptional | Image URL, including a same-origin resource path. Default: "". |
ImageDescription | stringOptional | Alternative text; empty marks a decorative image. Default: "". |
FocalPoint | stringOptional | CSS object position, for example 30% 50%; image always covers its frame. Default: "50% 50%". |
Eyebrow | stringOptional | Small introductory label. Default: "". |
Title | stringOptional | Main hero heading. Default: "Ideas made extraordinary.". |
Description | stringOptional | Supporting copy. Default: "". |
MinHeight | numberOptional | Minimum height in CSS pixels; content may increase it. Default: 640. |
OverlayOpacity | numberOptional | Dark overlay strength from 0 to 90; choose sufficient contrast for your image. Default: 55. |
Alignment | "Left" | "Center"Optional | Left or Center. Default: "Left". |
VerticalAlignment | "Center" | "Bottom"Optional | Center or Bottom. Default: "Center". |
HeadingLevel | numberOptional | Semantic heading level, 1 to 6. Default: 1. |
ContentWidth | "Wide" | "Narrow"Optional | Wide or Narrow content measure. Default: "Wide". |
AccessibleLabel | stringOptional | Optional accessible name; empty uses a sensible component label. Default: "". |
ExtendedClass | stringOptional | Additional classes on the component root. Default: "". |
Navigation | SlotOptional | Consumer-owned content, preserved during updates. |
Actions | SlotOptional | Consumer-owned content, preserved during updates. |
Content | SlotOptional | Consumer-owned content, preserved during updates. |
Callbacks
1| Name | Type / requirement | Usage |
|---|---|---|
Error | (message: string) => void | Promise<void>Optional |
Instance methods & properties
3| Name | Signature / type | Usage |
|---|---|---|
element | HTMLElement | Root owned by this instance. Dispose before removing its host. |
update | (patch: Partial<T.HeroSectionOptions>) => void | Apply a partial options update to this instance. |
destroy | () => void | Dispose the instance and its listeners when the view is removed. |
Related data types
Expand a type for its fields and allowed values.
Slot
type Slot = Node | string;Use these inputs, events, actions and structures in Service Studio. Names and data bindings are specific to the native Blocks.
Part of the full commercial BluKavantUI for OutSystems edition. View OutSystems editions →
Open OutSystems showcase ↗- Web runtime
- Partially supported
- TypeScript
- Partially supported
- OutSystems
- Partially supported
Statuses describe the component’s rendered code and interactions. Supply accessible content and follow the component guidance when integrating it.
Accessibility guidance →Purpose and use
Create a full-width introduction with a cover image, readable text and room for your main action.
Keyboard design guidance
Use a single page-level H1. Choose overlay strength and image crop that preserve readable contrast. Supply alt text only when the background image communicates content.
See the support status above for review coverage and any limitations.
In your application
Provide useful labels, preserve visible focus, and test the component with your actual content. Use text alongside status colors and check contrast in each state.
Events0No events yet.
Interact with an example to see its events.