Timeline

Dynamic timeline component for tracking mission progress, quest objectives, and sequential tasks with real-time updates.

Options

OptionTypeRequiredDefaultDescription
idstringYesnilUnique timeline identifier
titlestringYesnilTimeline title (supports markdown)
descriptionstringNonilTimeline description (supports markdown)
positionstringNo'right-center'Position: 'top-left', 'top-center', 'top-right', 'left-center', 'center', 'right-center', 'bottom-left', 'bottom-center', 'bottom-right'
iconstringNonilFontAwesome icon class
iconColorstringNo'#71717A'Icon color (hex or CSS color name)
iconAnimationstringNonilIcon animation: 'spin', 'spinPulse', 'spinReverse', 'pulse', 'beat', 'fade', 'beatFade', 'bounce', 'shake'
taskstableYes{}Array of task objects (see Task Properties)
opacitynumberNo1.0Background opacity (0.0-1.0)

Task Properties

OptionTypeRequiredDefaultDescription
idstringYesnilUnique task identifier
labelstringYesnilTask display text (supports markdown)
descriptionstringNonilTask description (supports markdown)
statusstringYesnilTask status: 'pending', 'active', 'completed', 'failed'
iconstringNoAutoFontAwesome icon class (overrides default status icon)
iconColorstringNoAutoIcon color (hex or CSS color name)
iconAnimationstringNoAutoIcon animation (custom icons require explicit animation)

Task Status Icons

Default icons assigned by status (can be overridden with custom icon):

  • pending: Circle icon (gray)
  • active: Spinner icon (blue, auto-spinning)
  • completed: Check circle icon (green)
  • failed: Times circle icon (red)

Functions

-- Show a timeline with tasks
exports.lation_ui:showTimeline(data)
 
-- Hide a timeline
exports.lation_ui:hideTimeline(id)
 
-- Update task(s) - supports both single and multiple updates
exports.lation_ui:updateTimelineTask(timelineId, taskData, status)
-- Single task: updateTimelineTask(timelineId, taskId, status)
-- Multiple tasks: updateTimelineTask(timelineId, tasksArray)
 
-- Add a new task to timeline
exports.lation_ui:addTimelineTask(timelineId, task)
 
-- Update timeline properties (title, description, icon, etc.)
exports.lation_ui:updateTimeline(timelineId, updates)
 
-- Get the currently active timeline ID
local timelineId = exports.lation_ui:getActiveTimeline()

Important Notes

  • Only one timeline can be active at a time - showing a new timeline will automatically hide any existing timeline
  • Tasks are displayed with a vertical timeline showing status progression
  • Active task status automatically triggers spinning animation on default icons
  • Custom task icons do not auto-animate unless iconAnimation is explicitly set
  • Timeline state is not preserved when hidden - you must pass full configuration when showing again

Example

-- Basic timeline with mission tasks
exports.lation_ui:showTimeline({
    id = 'heist_mission',
    title = 'Bank Heist',
    description = 'Complete all objectives to finish the heist',
    position = 'right-center',
    icon = 'fas fa-mask',
    iconColor = '#EF4444',
    opacity = 0.95,
    tasks = {
        { 
            id = 'gear', 
            label = 'Acquire equipment', 
            description = 'Get supplies from the warehouse',
            status = 'completed'
        },
        { 
            id = 'hack', 
            label = 'Hack security system', 
            description = 'Disable cameras and alarms',
            status = 'active'
        },
        { 
            id = 'vault', 
            label = 'Access the vault', 
            status = 'pending'
        },
        { 
            id = 'escape', 
            label = 'Escape the area', 
            status = 'pending'
        }
    }
})
-- Update single task when objective is completed
exports.lation_ui:updateTimelineTask('heist_mission', 'hack', 'completed')
-- Update multiple tasks at once (recommended for sequential progression)
exports.lation_ui:updateTimelineTask('heist_mission', {
    { id = 'hack', status = 'completed' },
    { id = 'vault', status = 'active' }
})
-- Add a new task dynamically
exports.lation_ui:addTimelineTask('heist_mission', {
    id = 'bonus',
    label = 'Bonus objective',
    description = 'Collect additional loot',
    status = 'pending',
    icon = 'fas fa-star',
    iconColor = '#F59E0B'
})
-- Update timeline properties (e.g., completion message)
exports.lation_ui:updateTimeline('heist_mission', {
    description = 'Heist Complete! +$50,000'
})
-- Hide timeline when mission ends
exports.lation_ui:hideTimeline('heist_mission')

Use Cases:

  • Mission/quest tracking systems
  • Multi-step tutorials or onboarding
  • Heist or robbery progress tracking
  • Delivery route progression
  • Achievement or challenge progress
  • Event phase indicators
  • Crafting or building sequences