TigriWeb Components
AttributesControlsMetaPrimitivesIntegrations
  • Table of Contents
  • Attributes
    • Checkbox
    • Color
    • ColorGradient
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
    • ToolbarButton
    • ToolbarGroup
  • Controls
    • AppenderButton
    • Media
    • RichHeading
    • RichText
  • Meta
    • Checkbox
    • Color
    • DateTime
    • Icon
    • Media
    • Number
    • PostType
    • PostTypeMultiple
    • Radio
    • Range
    • Select
    • Taxonomy
    • TaxonomyMultiple
    • Text
    • Textarea
    • Toggle
  • Primitives
    • HTML
    • SVG
  • Integrations
    • Enqueue SVG icons
    • Enqueue I18n strings
Powered by GitBook
On this page

Was this helpful?

  1. Meta

Range

PreviousRadioNextSelect

Last updated 6 months ago

Was this helpful?

TwebMetaRangeControl

{ label, help, min, max, step, metaKey* }
/**
 * @param {string} [label] - Component label.
 * @param {string} [help] - Component description.
 * @param {number} [min] - Minimum value (default: 0).
 * @param {number} [max] - Maximum value (default: 100).
 * @param {number} [step] - Step value (default: 1).
 * @param {string} metaKey - Registered meta key from register_post_meta().
 */
functions.php
register_post_meta( 'post_type_name', 'test_range', array(
	'type'         => 'number',
	'default'      => 3,
	'single'       => true,
	'show_in_rest' => true,
) );
index.js
import {
	TwebMetaRangeControl,
} from '@tigriweb/components/meta';
index.js | PanelBody
<TwebMetaRangeControl
	label={ __('Range Label', 'your-theme-name') }
	help={ __('Range Description', 'your-theme-name') }
	min="3"
	max="13"
	step="2"
	metaKey="test_range"
/>