Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

189
Views
How to make bold part of text , passed from object to react component?

This is the page html where I create the object. Part of description must be bold:

const agencyProps = {
  title: "Managed agency selection",
  paragraph: "Strengten your onboarding process",
  videoImage: {
    src: "/img/video.png",
    alt: "background",
    width: 330,
    height: 520,
  },

  selections: {
    cardOne: {
      title: "Brief",
      bold: "THIS",
      description: `Complete brief or simple guidance on what to include, we've got you covered`,
      width: "430px",
    },

    cardTwo: {
      title: "Search",
      description:
        "In-depth agency search covering, criteria matching, door knocking and due-dilligence vetting.",
      width: "460px",
    },

    cardThree: {
      title: "Pitch",
      description:
        "Comprehensive pitch management, including comms, diary management and pitch hosting.",
      width: "490px",
    },
  },
};

This is the component, where I pass the object property:

<StyledCard style={{ maxWidth: `${selections.cardTwo.width}` }}>
              <StyledIconWrapper>
                <FaSearch size="1x" color="#0f0f0f" />
              </StyledIconWrapper>
              <StyledTitleDescriptionWrapper>
                <StyledSelectTitle>
                  {selections.cardTwo.title}
                </StyledSelectTitle>
                <StyledSelectDescription>
                  {selections.cardTwo.description}
                </StyledSelectDescription>
              </StyledTitleDescriptionWrapper>
            </StyledCard>

I've tried to put in <b></b> the part which I like, tried with making getter and using "this" with property 'bold' but still cant manage to catch the words which i like to be bold. Hope explanation is ok and thanks in advance!

almost 4 years ago · Santiago Trujillo
3 answers
Answer question

0

One way is to wrap the text to be bold in a <strong> tag, e.g.:

cardOne: {    
    description: "This text is <strong>bold</strong>.",
    title: // ...
    width: // ...
}
almost 4 years ago · Santiago Trujillo Report

0

you have to use <strong> <strong/> tag and pass that to dangerouslySetInnerHTML more information on this page

almost 4 years ago · Santiago Trujillo Report

0

You can add <strong> or <b> tags around the part of the description you want bolded.

cardOne: {
    title: "Brief",
    description: `Complete brief or <b>simple guidance</b> on what to include, we've got you covered`,
    width: "430px"
  };

Then you can render the description with dangerouslySetInnerHTML.

<p dangerouslySetInnerHTML={{ __html: cardOne.description }} />
almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!