### Install OrcaUI via NPM or Yarn
Source: https://context7.com/orcasaga/orcaui/llms.txt
Install OrcaUI as a package for use with module bundlers and build systems.
```bash
# Install via npm
npm install orcaui
# Install via yarn
yarn add orcaui
```
--------------------------------
### OrcaUI Step Component Examples
Source: https://context7.com/orcasaga/orcaui/llms.txt
Use oc-step and oc-step-item to create progress indicators. Supports 'current', 'flipped', and 'inverted' states.
```html
```
--------------------------------
### Drawer Component Examples
Source: https://context7.com/orcasaga/orcaui/llms.txt
The oc-drawer component slides out panels from different sides. The 'bottom' placement automatically includes rounded top corners. Use the open() method to display the drawer.
```html
Settings
Drawer content here
Options
Bottom drawer automatically has rounded top corners
Open Right Drawer
Open Bottom Drawer
```
--------------------------------
### Import OrcaUI in JavaScript
Source: https://context7.com/orcasaga/orcaui/llms.txt
Import OrcaUI using ES Module, CommonJS, or UMD formats depending on your project setup.
```javascript
// ES Module import
import orca from 'orcaui/dist/js/orca.esm.js';
// CommonJS require
const orca = require('orcaui/dist/js/orca.cjs.js');
// UMD format (browser global)
// Available as window.orca after including orca.js
```
--------------------------------
### OrcaUI Buoy Component Examples
Source: https://context7.com/orcasaga/orcaui/llms.txt
The oc-buoy component displays notification badges or dot indicators. It can be 'flipped' and styled with CSS variables.
```html
MessagesNotifications
```
--------------------------------
### Initialize Viewer Module
Source: https://context7.com/orcasaga/orcaui/llms.txt
Configures the image gallery viewer with specific tools and event callbacks.
```html
```
--------------------------------
### Basic Popup and Dialog with Actions
Source: https://context7.com/orcasaga/orcaui/llms.txt
Use oc-popup for modal content and oc-dialog for confirmation dialogs. Dialogs support a footer slot for action buttons. Use the open() and close() methods to control visibility.
```html
Popup Title
This is popup content.
Open Popup
```
```html
Are you sure you want to proceed?
CancelConfirm
```
```javascript
function confirmAction() {
console.log('Action confirmed');
document.querySelector('#confirmDialog').close();
}
```
--------------------------------
### Use Utility Functions
Source: https://context7.com/orcasaga/orcaui/llms.txt
Provides helpers for DOM element selection, visibility detection, and date conversion.
```javascript
// Get single element (works inside template elements)
const element = orca.getEl('#myElement');
const templateChild = orca.getEl('.item', document.querySelector('template'));
// Get multiple elements (works inside template elements)
const elements = orca.getEls('.list-item');
const templateItems = orca.getEls('.item', document.querySelector('template'));
// Check if child is visible within scrollable parent
const parent = document.querySelector('.scroll-container');
const child = document.querySelector('.target-item');
const isVisible = orca.isChildVisible(parent, child);
console.log('Child is visible in parent:', isVisible);
// Convert various date formats to local time
const localTime = orca.toLocalTime('2025-07-26T10:30:00Z');
const localTime2 = orca.toLocalTime('July 26, 2025 10:30 AM');
console.log('Local time:', localTime);
```
--------------------------------
### Implement Datetime Component
Source: https://context7.com/orcasaga/orcaui/llms.txt
Configures date and time pickers with various formatting options and provides access to date utility tools.
```html
```
--------------------------------
### Initialize Lazy Loading Module
Source: https://context7.com/orcasaga/orcaui/llms.txt
Implements lazy loading for images using Intersection Observer. Elements trigger loading when they partially enter the viewport.
```html
```
--------------------------------
### Implement Search Component
Source: https://context7.com/orcasaga/orcaui/llms.txt
Configures search input fields with various styling options and event listeners for input and submission.
```html
```
--------------------------------
### Implement File Upload Component
Source: https://context7.com/orcasaga/orcaui/llms.txt
Configures file selection inputs with support for multiple files and custom localization labels.
```html
Select DocumentSelect ImagesUpload Files
```
--------------------------------
### Basic and Multi-select Dropdowns
Source: https://context7.com/orcasaga/orcaui/llms.txt
Use oc-select for single or multiple item selections. Listen for the 'change' event to capture selected values.
```html
United StatesUnited KingdomCanada
```
```html
JavaScriptCSSHTML
```
```javascript
const select = document.querySelector('oc-select');
select.addEventListener('change', (e) => {
console.log('Selected value:', e.target.value);
});
```
--------------------------------
### Basic OrcaUI Button Component (Btn)
Source: https://context7.com/orcasaga/orcaui/llms.txt
Use the oc-btn tag for basic button functionality. Listen for click events using standard JavaScript.
```html
Click MeSelected ButtonPrimarySuccessWarningDanger
Save Document
```
--------------------------------
### Include OrcaUI via CDN
Source: https://context7.com/orcasaga/orcaui/llms.txt
Include OrcaUI's CSS and JavaScript files using CDN links in your HTML for immediate use.
```html
OrcaUI App
```
--------------------------------
### Configure CSS Variables and Theme Toggling
Source: https://context7.com/orcasaga/orcaui/llms.txt
Defines global CSS custom properties for theming and provides a JavaScript function to toggle between light and dark modes.
```html
Toggle Theme
```
--------------------------------
### Implement Swipe Component
Source: https://context7.com/orcasaga/orcaui/llms.txt
Configures touch-enabled carousels with thumbnail association and programmatic navigation.
```html
```
--------------------------------
### Configure Scroll Module
Source: https://context7.com/orcasaga/orcaui/llms.txt
Provides smooth scrolling with support for horizontal and vertical flow. Use the scrollTo method to programmatically navigate to a specific position.
```html
```
--------------------------------
### Format Text and Numbers
Source: https://context7.com/orcasaga/orcaui/llms.txt
Handles text formatting for currency, numbers, and Pinyin phonetic notation using the oc-format component.
```html
```
--------------------------------
### Gesture Module for Touch and Mouse Input
Source: https://context7.com/orcasaga/orcaui/llms.txt
The orca.Gesture module handles touch and mouse gestures on a specified element, including zoom and pan. It supports image transformations like flipping.
```html
```
```javascript
const gesture = new orca.Gesture('#gestureArea', {
step: { value: 0.1 },
onZoom: (scale) => {
console.log('Current zoom scale:', scale);
},
onPan: (x, y) => {
console.log('Pan position:', x, y);
}
});
// Gesture works correctly even when image is flipped
const img = document.querySelector('#gestureImage');
img.style.transform = 'scaleX(-1)'; // Horizontal flip
// Gesture zoom still works correctly after flip
```
--------------------------------
### Implement Range Component
Source: https://context7.com/orcasaga/orcaui/llms.txt
Configures numeric slider inputs with horizontal or vertical orientation and event handling.
```html
```
--------------------------------
### Tags Input Management
Source: https://context7.com/orcasaga/orcaui/llms.txt
The oc-tags component allows managing lists of tags with add/remove functionality. Listen for the 'output' event for tag changes and use the 'updateCont' method for programmatic updates.
```html
JavaScriptWeb Development
```
```javascript
const tags = document.querySelector('oc-tags');
// Listen for output events when tags change
tags.addEventListener('output', (e) => {
console.log('Current tags:', e.detail);
});
// Programmatically update content
tags.updateCont(['react', 'vue', 'angular']);
```
--------------------------------
### OrcaUI Icon Component Usage
Source: https://context7.com/orcasaga/orcaui/llms.txt
Render icons using the oc-icon tag, specifying the icon name. Icons can be flipped and colored using CSS variables.
```html
```
--------------------------------
### Implement Form Validation
Source: https://context7.com/orcasaga/orcaui/llms.txt
Handles form field validation with debounced timing and custom submit event listeners. Requires the Valid library and specific oc-field tags.
```html
```
--------------------------------
### Progress Bar Customization
Source: https://context7.com/orcasaga/orcaui/llms.txt
The oc-progress component displays progress bars. Customize value, max, width, and size. The 'value' attribute can be updated programmatically to show progress changes.
```html
```
```javascript
const progress = document.querySelector('oc-progress');
// Update progress programmatically
let value = 0;
const interval = setInterval(() => {
value += 10;
progress.setAttribute('value', value);
if (value >= 100) clearInterval(interval);
}, 500);
```
--------------------------------
### Validate Data with Regular Expressions
Source: https://context7.com/orcasaga/orcaui/llms.txt
Utilizes built-in regex patterns for common formats like email, phone, credit cards, and UUIDs.
```javascript
// Available regex patterns
const patterns = orca.regExps;
// Email validation
const isValidEmail = patterns.email.test('user@example.com');
// Phone validation
const isValidPhone = patterns.phone.test('+1-555-123-4567');
// Credit card validation (added in v1.0.3)
const isValidCard = patterns.creditCard.test('4111111111111111');
// UUID validation (added in v1.0.3)
const isValidUUID = patterns.uuid.test('550e8400-e29b-41d4-a716-446655440000');
// URL validation
const isValidURL = patterns.url.test('https://example.com');
console.log({
email: isValidEmail,
phone: isValidPhone,
creditCard: isValidCard,
uuid: isValidUUID,
url: isValidURL
});
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.