To perform advanced layout customization, you must import RHAP_UI alongside the AudioPlayer component. RHAP_UI provides constant tokens that represent the built-in UI elements (like the progress bar, volume controls, etc.), allowing you to reorder or inject custom React elements into specific sections of the player.
Available Layouts
The layout prop accepts the following string values:
'stacked' (Default)'horizontal''stacked-reverse''horizontal-reverse'
Section Customization Props
You can reorder or replace the contents of the following sections:
customProgressBarSection: An array of string (using RHAP_UI tokens) or ReactElement. Default: [RHAP_UI.CURRENT_TIME, RHAP_UI.PROGRESS_BAR, RHAP_UI.DURATION]customControlsSection: An array of string or ReactElement. Default: [RHAP_UI.ADDITIONAL_CONTROLS, RHAP_UI.MAIN_CONTROLS, RHAP_UI.VOLUME_CONTROLS]customAdditionalControls: An array of string or ReactElement. Default: [RHAP_UI.LOOP]customVolumeControls: An array of string or ReactElement. Default: [RHAP_UI.VOLUME]
import AudioPlayer, { RHAP_UI } from 'react-h5-audio-player'