### Cleave.js Time Formatting Examples
Source: https://themesbrand.com/velzon/docs/symfony/input-mask
Provides examples for formatting time inputs using Cleave.js. The first example formats hours, minutes, and seconds (HH:MM:SS), while the second formats only hours and minutes (HH:MM).
```javascript
var cleaveTime = new Cleave('#cleave-time', {
time: true,
timePattern: ['h', 'm', 's']
});
var cleaveTimeFormat = new Cleave('#cleave-time-format', {
time: true,
timePattern: ['h', 'm']
});
```
--------------------------------
### Initialize Flatpickr for Date Range Selection
Source: https://themesbrand.com/velzon/docs/symfony/flatpickr
This example configures Flatpickr to allow users to select a date range. By setting `data-range-date` to `true`, the picker will facilitate the selection of a start and end date.
```html
```
--------------------------------
### Cleave.js Custom Input Formatting Examples
Source: https://themesbrand.com/velzon/docs/symfony/input-mask
Illustrates various custom formatting options with Cleave.js, including credit card numbers, delimited numbers, prefixed inputs, and phone numbers. These examples show how to configure blocks, delimiters, prefixes, and other properties for specific input requirements.
```javascript
var cleaveBlocks = new Cleave('#cleave-ccard', {
blocks: [4, 4, 4, 4],
uppercase: true
});
var cleaveDelimiter = new Cleave('#cleave-delimiter', {
delimiter: '·',
blocks: [3, 3, 3],
uppercase: true
});
var cleaveDelimiters = new Cleave('#cleave-delimiters', {
delimiters: ['.', '.', '-'],
blocks: [3, 3, 3, 2],
uppercase: true
});
var cleavePrefix = new Cleave('#cleave-prefix', {
prefix: 'PREFIX',
delimiter: '-',
blocks: [6, 4, 4, 4],
uppercase: true
});
var cleaveBlocks = new Cleave('#cleave-phone', {
delimiters: ['(', ')', '-'],
blocks: [0, 3, 3, 4]
});
```
--------------------------------
### List.js Initialization with Pagination
Source: https://themesbrand.com/velzon/docs/symfony/listjs
Sets up List.js to include pagination, breaking down a long list into manageable pages. This example configures pagination with a page size of 3 items.
```javascript
var paginationList = new List('pagination-list', {
valueNames: ['pagi-list'],
page: 3,
pagination: true
});
```
--------------------------------
### List.js Initialization for Existing HTML List
Source: https://themesbrand.com/velzon/docs/symfony/listjs
This example shows how to initialize List.js on an existing HTML list structure. It defines the `valueNames` to map to the elements within each list item.
```javascript
var existOptionsList = {
valueNames: [ 'contact-name', 'contact-message' ]
};
var existList = new List('contact-existing-list', existOptionsList);
```
--------------------------------
### HTML Basic Select Example
Source: https://themesbrand.com/velzon/docs/symfony/select2
Demonstrates a simple HTML select element configured for basic single selection using Select2. This serves as a foundational example for implementing dropdowns.
```html
```
--------------------------------
### Initialize Pie Charts (JavaScript)
Source: https://themesbrand.com/velzon/docs/symfony/apexcharts
This script initializes pie charts using ApexCharts. It requires the ApexCharts library and custom JavaScript for chart setup. The output is a rendered pie chart.
```html
```
--------------------------------
### Initialize Flatpickr with Date and Time Selection
Source: https://themesbrand.com/velzon/docs/symfony/flatpickr
This example initializes Flatpickr to allow both date and time selection. The `data-enable-time` attribute enables the time picker, and `data-date-format` can be adjusted for desired date and time output.
```html
```
--------------------------------
### Swiper Slider with Navigation and Pagination
Source: https://themesbrand.com/velzon/docs/symfony/swiper-slider
This example demonstrates initializing a Swiper slider with custom navigation buttons (next/prev) and a clickable pagination element. It also includes looping and autoplay.
```javascript
var swiper = new Swiper(".navigation-swiper", {
loop: true,
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
clickable: true,
el: ".swiper-pagination",
},
});
```
--------------------------------
### Multi-Element Range Handle Slider in JavaScript
Source: https://themesbrand.com/velzon/docs/symfony/nouislider
Shows how to create a slider with multiple handles for range selection. This example initializes a slider with two starting values and enables a connected range. It's useful for defining a minimum and maximum within a set boundary.
```javascript
var multielementslider = document.querySelectorAll('[data-multielement]');
multielementslider.forEach(function (slider) {
noUiSlider.create(slider, {
start: [20, 80],
connect: true,
range: {
'min': 0,
'max': 100
}
});
});
```
--------------------------------
### Initialize Multi.js - Basic Example
Source: https://themesbrand.com/velzon/docs/symfony/multi-js
Initializes Multi.js on a select element with the ID 'multiselect-basic'. This basic setup disables the search functionality.
```javascript
var multiSelectBasic = document.getElementById("multiselect-basic");
multi(multiSelectBasic, {
enable_search: false
});
```
--------------------------------
### Cleave.js Date Formatting Examples
Source: https://themesbrand.com/velzon/docs/symfony/input-mask
Demonstrates how to use Cleave.js to format date inputs. The first example shows a full date format (DD-MM-YYYY), while the second illustrates a shorter format (MM-YY). Ensure the target HTML elements have the corresponding IDs.
```javascript
var cleaveDate = new Cleave('#cleave-date', {
date: true,
delimiter: '-',
datePattern: ['d', 'm', 'Y']
});
var cleaveDateFormat = new Cleave('#cleave-date-format', {
date: true,
datePattern: ['m', 'y']
});
```
--------------------------------
### Swiper Slider with Custom Pagination Bullets
Source: https://themesbrand.com/velzon/docs/symfony/swiper-slider
This example sets up a Swiper slider with custom pagination bullets, rendered using a provided function. The bullets are numbered starting from 1. Includes looping and autoplay.
```javascript
var swiper = new Swiper(".pagination-custom-swiper", {
loop: true,
autoplay: {
delay: 2500,
disableOnInteraction: false,
},
pagination: {
clickable: true,
el: ".swiper-pagination",
renderBullet: function (index, className) {
return '' + (index + 1) + "";
},
}
});
```
--------------------------------
### Grid.js Pagination Example with Custom Formatting in Javascript
Source: https://themesbrand.com/velzon/docs/symfony/gridjs
This Javascript example demonstrates a Grid.js table with pagination enabled. It features custom formatting for the 'ID' column and an 'Actions' column. The table displays order details including ID, Name, Date, Total, and Status, and is rendered into the 'table-pagination' element.
```javascript
new gridjs.Grid({
columns: [{
name: 'ID',
width: '120px',
formatter: (function (cell) {
return gridjs.html('' + cell + '');
})
},"Name", "Date", "Total", "Status",
{
name: 'Actions',
width: '100px',
formatter: (function (cell) {
return gridjs.html("" +
"Details" +
"");
})
},
],
pagination: {
limit: 5
},
data: [
["#VL2111", "Jonathan", "07 Oct, 2021", "$24.05", "Paid",],
["#VL2110", "Harold", "07 Oct, 2021", "$26.15", "Paid"],
["#VL2109", "Shannon", "06 Oct, 2021", "$21.25", "Refund"],
["#VL2108", "Robert", "05 Oct, 2021", "$25.03", "Paid"],
["#VL2107", "Noel", "05 Oct, 2021", "$22.61", "Paid"],
["#VL2106", "Traci", "04 Oct, 2021", "$24.05", "Paid"],
["#VL2105", "Kerry", "04 Oct, 2021", "$26.15", "Paid"],
["#VL2104", "Patsy", "04 Oct, 2021", "$21.25", "Refund"],
["#VL2103", "Cathy", "03 Oct, 2021", "$22.61", "Paid"],
["#VL2102", "Tyrone", "03 Oct, 2021", "$25.03", "Paid"],
]
}).render(document.getElementById("table-pagination"));
```
--------------------------------
### HTML Templating Example
Source: https://themesbrand.com/velzon/docs/symfony/select2
Presents an HTML select element demonstrating custom templating with Select2. This allows for richer display of options, including formatting and additional information.
```html
```
--------------------------------
### Initialize Basic Datatable in Javascript
Source: https://themesbrand.com/velzon/docs/symfony/datatables
This snippet shows the basic initialization of a Datatable on an HTML element with the ID 'example'. It requires the DataTable library to be included. The output is a fully functional, interactive table.
```javascript
document.addEventListener('DOMContentLoaded', function () {
let table = new DataTable('#example');
});
```
--------------------------------
### Grid.js Base Example with Custom Formatting in Javascript
Source: https://themesbrand.com/velzon/docs/symfony/gridjs
This Javascript example showcases a basic Grid.js table with custom formatters for the 'ID' and 'Email' columns, along with an 'Actions' column for integrating buttons. It includes pagination, sorting, and search functionalities and renders the table into the 'table-gridjs' element.
```javascript
new gridjs.Grid({
columns: [
{
name: 'ID',
formatter: (function (cell) {
return gridjs.html('' + cell + '');
})
},
"Name",
{
name: 'Email',
formatter: (function (cell) {
return gridjs.html('' + cell + '');
})
},
"Position", "Company", "Country",
{
name: 'Actions',
width: '120px',
formatter: (function (cell) {
return gridjs.html("" +
"Details" +
"");
})
},
],
pagination: {
limit: 5
},
sort: true,
search: true,
data: [
["01", "Jonathan", "jonathan@example.com","Senior Implementation Architect",
"Hauck Inc", "Holy See"],
["02", "Harold", "harold@example.com", "Forward Creative Coordinator",
"Metz Inc", "Iran"],
["03", "Shannon", "shannon@example.com","Legacy Functionality Associate",
"Zemlak Group", "South Georgia"],
["04", "Robert", "robert@example.com","Product Accounts Technician",
"Hoeger", "San Marino"],
["05", "Noel", "noel@example.com","Customer Data Director",
"Howell - Rippin", "Germany"],
["06", "Traci", "traci@example.com","Corporate Identity Director",
"Koelpin - Goldner", "Vanuatu"],
["07", "Kerry", "kerry@example.com","Lead Applications Associate",
"Feeney, Langworth and Tremblay", "Niger"],
["08", "Patsy", "patsy@example.com","Dynamic Assurance Director",
"Streich Group", "Niue"],
["09", "Cathy", "cathy@example.com","Customer Data Director",
"Ebert, Schamberger and Johnston", "Mexico"],
["10", "Tyrone", "tyrone@example.com", "Senior Response Liaison",
"Raynor, Rolfson and Daugherty", "Qatar"],
]
}).render(document.getElementById("table-gridjs"));
```
--------------------------------
### Initialize Bubble Charts (JavaScript)
Source: https://themesbrand.com/velzon/docs/symfony/apexcharts
This script initializes bubble charts using ApexCharts. It requires the ApexCharts library and custom JavaScript for setup. The result is a functional bubble chart displayed on the page.
```html
```
--------------------------------
### Initialize Flatpickr with Min and Max Date Constraints
Source: https://themesbrand.com/velzon/docs/symfony/flatpickr
This example demonstrates how to set minimum and maximum selectable dates using Flatpickr. The `data-minDate` and `data-maxDate` attributes accept date strings in the specified format, restricting user selection to a specific range.
```html
```
--------------------------------
### Initialize Sweetalert2
Source: https://themesbrand.com/velzon/docs/symfony/sweetalert2
This snippet shows how to include the initialization JavaScript file for Sweetalert2. This file typically contains custom configurations and usage examples.
```javascript
```
--------------------------------
### Display Line Awesome Icons
Source: https://themesbrand.com/velzon/docs/symfony/icons
Provides an example of using Line Awesome icons, which are line-style icons accessible with a single line of code. Replace '**' with the specific icon identifier.
```html
```
--------------------------------
### Initialize Polararea Charts (JavaScript)
Source: https://themesbrand.com/velzon/docs/symfony/apexcharts
This script initializes polar area charts using ApexCharts. It depends on the ApexCharts library and custom JavaScript for setup. The final output is a polar area chart visualization.
```html
```
--------------------------------
### JavaScript: ApexCharts Line Chart Integration
Source: https://themesbrand.com/velzon/docs/symfony/apexcharts
Includes the ApexCharts library and a sample data script for creating line charts. It also points to the initialization script for line chart examples.
```javascript
```
--------------------------------
### HTML Multi Select Example
Source: https://themesbrand.com/velzon/docs/symfony/select2
Illustrates an HTML select element configured for multiple selections with Select2. It includes optgroups to categorize options, facilitating better organization and user experience.
```html
```
--------------------------------
### Initialize Star Rater with Step Values
Source: https://themesbrand.com/velzon/docs/symfony/ratings
This example shows how to initialize a raterJs instance that allows for ratings with decimal steps (e.g., 1.5). The `rating` option is set to a decimal value, and the `rateCallback` handles the update.
```javascript
var starRatingStep = raterJs( {
starSize:22,
rating:1.5,
element:document.querySelector("#rater-step"),
rateCallback:function rateCallback(rating, done) {
this.setRating(rating);
done();
}
});
```
--------------------------------
### Initialize and Configure Shepherd.js Tour in JavaScript
Source: https://themesbrand.com/velzon/docs/symfony/shepherdjs-tour
This JavaScript code initializes and configures a Shepherd.js tour. It sets default options for steps, including modal overlays and navigation buttons, and defines multiple steps with specific content, attachment points, and actions for guiding users through an application interface.
```javascript
var tour = new Shepherd.Tour({
defaultStepOptions: {
cancelIcon: {
enabled: true
},
classes: 'shadow-md bg-purple-dark',
scrollTo: { behavior: 'smooth', block: 'center' }
},
useModalOverlay:{
enabled: true
},
});
tour.addStep({
title: 'Welcome Back !',
text: 'This is Step 1',
attachTo: {
element: '#logo-tour',
on: 'bottom'
},
buttons: [
{
text: 'Next',
classes: 'btn btn-success',
action: tour.next
}
]
});
// end step 1
tour.addStep({
title: 'Register your account',
text: 'Get your Free Velzon account now.',
attachTo: {
element: '#register-tour',
on: 'bottom'
},
buttons: [
{
text: 'Back',
classes: 'btn btn-light',
action: tour.back
},
{
text: 'Next',
classes: 'btn btn-success',
action: tour.next
}
]
});
// end step 2
tour.addStep({
title: 'Login your account',
text: 'Sign in to continue to Velzon.',
attachTo: {
element: '#login-tour',
on: 'bottom'
},
buttons: [
{
text: 'Back',
classes: 'btn btn-light',
action: tour.back
},
{
text: 'Next',
classes: 'btn btn-success',
action: tour.next
}
]
});
// end step 3
tour.addStep({
title: 'Get yout Product',
text: 'Sign in to continue to Velzon.',
attachTo: {
element: '#getproduct-tour',
on: 'bottom'
},
buttons: [
{
text: 'Back',
classes: 'btn btn-light',
action: tour.back
},
{
text: 'Next',
classes: 'btn btn-success',
action: tour.next
}
]
});
// end step 4
tour.addStep({
title: 'Thank you !',
text: 'Sign in to continue to Velzon.',
attachTo: {
element: '#thankyou-tour',
on: 'bottom'
},
buttons: [
{
text: 'Back',
classes: 'btn btn-light',
action: tour.back
},
{
text: 'Thank you !',
classes: 'btn btn-primary',
action: tour.complete
}
]
});
// end step 5
tour.start();
```
--------------------------------
### Include Shepherd.js CSS and JavaScript Libraries
Source: https://themesbrand.com/velzon/docs/symfony/shepherdjs-tour
This snippet shows how to include the necessary CSS and JavaScript files for Shepherd.js, a library used for guiding users through tours of an application. Ensure these paths are correct in your project.
```html
```
--------------------------------
### Cleave.js Numeral Formatting Example
Source: https://themesbrand.com/velzon/docs/symfony/input-mask
Shows how to apply numeral formatting to an input field using Cleave.js, specifically setting the thousands group style to 'thousand'. This is useful for displaying large numbers in a more readable format.
```javascript
var cleaveNumeral = new Cleave('#cleave-numeral', {
numeral: true,
numeralThousandsGroupStyle: 'thousand'
});
```
--------------------------------
### Move noUiSlider with Clicked Pips
Source: https://themesbrand.com/velzon/docs/symfony/nouislider
This example demonstrates how to allow users to move the noUiSlider handles by clicking on the pips. It creates a slider with pips enabled and then adds event listeners to each pip to set the slider's value accordingly. Dependencies include the noUiSlider library.
```javascript
var pipsSlider = document.getElementById('slider-pips');
noUiSlider.create(pipsSlider, {
range: {
min: 0,
max: 100
},
start: [50],
pips: {mode: 'count', values: 5}
});
var pips = pipsSlider.querySelectorAll('.noUi-value');
function clickOnPip() {
var value = Number(this.getAttribute('data-value'));
pipsSlider.noUiSlider.set(value);
}
for (var i = 0; i < pips.length; i++) {
// For this example. Do this in CSS!
pips[i].style.cursor = 'pointer';
pips[i].addEventListener('click', clickOnPip);
}
```
--------------------------------
### HTML Disabling Select2 Control Example
Source: https://themesbrand.com/velzon/docs/symfony/select2
Shows HTML select elements for both single and multi-select scenarios, demonstrating how to disable and enable Select2 controls programmatically. Includes buttons to trigger these actions.
```html