Creating an interactive R shiny app with golem: incorporating a pre-existing design system (CSS+JS) efficiently

Currently, I am in the process of creating a Shiny App using the golem package. My intention is to incorporate an established design system (located at https://github.com/GouvernementFR/dsfr), which includes numerous css and js files.

Suppose my golem Shiny App is as follows:

app_ui <- function(request) {
  tagList(
    golem_add_external_resources(),
    ui <- fluidPage(
      actionButton("button","Button")
  ))
}
# The server section is not needed for now
app_server <- function(input, output, session) {
}

I am encountering difficulties with certain specifics, such as in the button.css file, where the button is named "fr-btn" instead of the usual "btn". How can I inform my golem Shiny app that my actionButtons should now be referred to as "fr-btn"?

.fr-btn {
  --text-spacing: 0;
  --title-spacing: 0;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  width: -moz-fit-content;
  width: fit-content;
  --idle: transparent;
  color: var(--text-inverted-blue-france);
}

Is there a simple method to copy the entire design system folder into my app's www folder and have it operational?

Apologies for any simplistic queries, I am still learning to utilize both the golem framework and custom CSS.

Answer №1

Introducing the integration of dsfr into our {shinygouv} project:

Visit our GitHub repository here

Please keep in mind that we are still working on implementing all features, but it's coming along nicely :)

Sincerely, Colin

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Ways to structure a div to resemble a table

I'm currently working on a form that has multiple input fields, and I'm looking to structure them in a specific way. The layout I want to achieve can be seen in this example: https://jsfiddle.net/dmilos89/58ea82gj/2/ The example above utilizes ...

The table's content extends beyond the confines of the page

I have an HTML page where I am embedding an SSRS report. The report extends beyond the page as shown in the image below: This is the table that is generated: <table cellpadding="0" cellspacing="0" id="ctl00_MainContent_FiveYearReportViewer_fixedTable" ...

Utilizing the CSS transform scale() function to enlarge an element while preserving its entire content and allowing for scrolling

Check out this live example: https://jsfiddle.net/b8vLg0ny/ You can actually utilize the CSS functions scale and translate to magnify an element. For instance, consider a scenario with 4 boxes arranged in a 2x2 grid. The HTML code for this setup is as f ...

In what way does Google+ make their logo come to life on the left side of the navigation bar when the scrollbar is minimized?

I'm curious about the animation Google+ uses to make their logo slide in on the navigation bar when it shrinks. I've managed to shrink the scrollbar on scroll, but I can't quite replicate their technique for animating the icons. I'm eag ...

Tips for enlarging the box width using animation

How can I create an animation that increases the width of the right side of a box from 20px to 80px by 60px when hovered over? What would be the jQuery code for achieving this effect? ...

Easily adjust the width of divs within a parent container using CSS for a seamless and uniform

I am designing a webpage where I have set the container width to 100% to cover the entire screen width. Inside this container, I have multiple DIVs arranged in a grid structure with a float: left property and no fixed width, just a margin of 10px. Is ther ...

The alignment of the HTML and CSS speech bubble is experiencing issues

I need help with CSS as I am new to it and trying to create a speech bubble. However, when the text inside the bubble is long, it overlaps the timestamp. I am currently using `display: inline-block;` in my CSS. Below are snippets of my HTML and CSS code: ...

Contrast between ls() and objects()

Can you explain the differences between the functions ls() and objects()? I ran the code below, and surprisingly got identical results: x <- 1:10 y <- letters z <- month.abb Output: > ls() [1] "x" "y" "z" > objects() [1] "x" "y" "z" ...

What is the process of transforming HTML lists into a data frame using R?

I am facing a challenge where I need to parse HTML elements and convert them into values stored in a dataframe. Take this piece of HTML for example: <div class="header"> <h3>title 1</h3> </div> <div class="content"> <ul&g ...

What steps should be followed to construct a Term-Document-Matrix using a collection of texts and a predefined set of terms?

Here are the two sets of data I have: a set of tags (single words like php, html, etc) a set of texts My goal is to create a Term-Document-Matrix that shows the frequency of occurrences of each tag element in the text element. I have explored the R ...

Require assistance in adjusting a personalized dropdown menu and updating the selected value

I have created a unique custom dropdown feature as shown below: view image description here Upon selecting an option from the list, the main value will update and a label will float above it. view image description here $(".custom-dropdown-main").clic ...

Can CSS transitions be synced up to happen simultaneously?

Here is a snippet of code showcasing CSS transitions applied to the height property. It seems that CSS transitions work asynchronously, but I am curious if there's a way to make them synchronous without using jQuery or other methods. CSS: .animated ...

Curved edges achieved without the need for relative positioning

Can anyone help me with a specific code snippet to achieve rounded corners for this page ? Currently, I am using the PIE.htc file which only works when I declare position:relative; throughout the layout, causing disruptions. Is there a code workaround that ...

Should CSS properties be applied directly to the html tag?

Surprisingly, I recently discovered that it's possible to set the background-color of the html tag. It seems strange since I always thought the body was responsible for containing the first rendered tag. I used to believe that the html tag was just a ...

Can you explain the functionality of this CSS rule: ~"-moz-calc(..)"?

As I was reviewing some CSS code, I came across a rule that appeared like this: width: ~"-moz-calc(100% - 10px)"; While I am familiar with -moz-calc, I am puzzled by why this is enclosed in a string and what exactly is the purpose of the '~' sy ...

Issues with CSS pseudo classes :hover and :active not functioning as expected

As I attempted to create a game, an immediate CSS issue arose. It seems that the pseudo-classes I am utilizing are not functioning as intended. If you'd like to examine my code, it's available here. Try out the Fiddle CSS #button { width: ...

Potential issue: Firefox causes distortion in animated stroke-linecap="round" properties

While working on a project on Stack Overflow, I noticed a potential bug in Firefox when animating a line with stroke-linecap="round" and vector-effect="non-scaling-stroke" svg{border:1px solid} path{ animation: draw 1s ease-in; ...

Tips for customizing the appearance of a label when a MUI Radio Button is selected

Hello everyone, I am attempting to customize the label text color of a radio button to turn blue when selected. https://i.stack.imgur.com/btSc2.jpg HERE IS THE CODE FOR MY MUI BUTTON SO FAR import * as React from "react"; import Radio from &quo ...

Filter the subset by checking for duplicate IDs and if the value matches the value in another column in the next row

I have a DataFrame df that looks like this: ID VALUE_1 VALUE_2 VALUE_3 Pete 55 52 53 Amber 23 33 47 Amber 47 25 69 Bob 34 25 52 Bob 52 78 93 Bob ...

Is there a way to substitute a specific character in all column names using R?

I am currently working with a vast dataset of SNPs, and some of them are not formatted in a way that is compatible with the machine learning package I am using. The presence of hyphens in certain column names is causing issues, so I am attempting to replac ...