Spangled in beads and sequins, Karen O pranced across the stage looking as if she’d just gotten in a fight with a craft store and won. Did that explain her smile? Or was she simply having as good a time as everybody else?

It was Saturday afternoon at Merriweather Post Pavilion, and one of the most captivating stage personas in a generation was making magic with her Yeah Yeah Yeahs at the fourth annual Sweetlife Festival, a smartly curated collision of music and food presented by local salad restaurant chain Sweetgreen.

What the company kicked off four springtimes ago in a Dupont Circle parking lot has since bloomed into the region’s unofficial portal into the summer concert season. Saturday’s festivities mustered roughly 18,000 fans, 22 acts and dozens of vendors peddling Maine-style lobster rolls, Korean barbecue tacos, vegan oatmeal cream pies and other fancy edibles.

Deciding what to chew on was tricky, but deciding where to plant yourself was pretty simple — acts were sprinkled across three stages, but the main stage lineup exerted an almost inescapable gravity.

Gotham rock vets the Yeah Yeah Yeahs gave a snarling set there, proving why it’s a band that should never be missed. French rock troupe Phoenix employed much milder manners to the same effect. And there were pleasing turns from California rapper Kendrick Lamar, neo-bluesman Gary Clark Jr. and R&B singer Solange. The only bad apple in the barrel was Passion Pit, whose emotive pop-rock has always felt like a too-long hug from a very sweaty person.

But the Massachusetts band remains beloved, which explains why Brooklyn’s Holy Ghost! had such a paltry crowd during its competing slot on the festival’s secondary stage. Singer Alex Frankel wasn’t fazed, however, chain-smoking through a brisk set of ’80s-flashback pop that boasted enough fresh spark to earn the band the exclamation point on the end of its name.

Other side-stagers struggled for different reasons. New York twosome MS MR performed synth-pop ditties that favored style over personality. Bolo-tied California singer Nicky Blitz trapped himself in an awkward pose between David Byrne and Jon Spencer. And the District’s own Shark Week bravely kicked off the day, charging through ramshackle rock tunes for a scrum of teens sinking in mud produced by Friday night’s thunderstorms.

The elements were wacky on Saturday, as if the festival’s sound engineers were haphazardly spinning the dials on some sci-fi weather machine. There were blasts of sunshine and spasms of rain, but it was all friendly blue skies during a rude blues-rock set from Clark.

After the Texas-raised guitarist pushed toward the colossal during “If You Love Me Like You Say” — a song that recycles a melodic phrase from Jimi Hendrix’s “Third Stone From the Sun” — the audience chanted his name. GARR-EEEE! GARR-EEEE! The “Guitar Hero” generation has found one to claim as its own.

Lamar soaked up even louder cheers, symbolic of the embrace he has received from hip-hop’s fractured constituencies. Teens talk about him as if he fell from the sky. Aging hip-hop heads see him as an heir to their heroes. Onstage, he was both, shuffling the decks of tradition and innovation with a charisma that cast its spell up the amphitheater seats and across the Merriweather lawn.

Solange delivered the most muted main-stage set, but it felt purposeful. Instead of bold colors — the kind her older sister Beyonce uses almost exclusively — she rendered her R&B in soft pastels. Instead of belting her refrains, she fluttered. Instead of choreographing each step, her dancing felt relaxed and spontaneous. But it was still easy to get the sense that she was silently dying for our adulation, which brought a curious tension to all those breezy melodies.

Phoenix guitarists Christian Mazzalai and Laurent Brancowitz could be spotted nodding along during her set, milling around in the audience like your average French rock stars next door. Earlier in the day, Brancowitz was up on the concourse, inconspicuously plunking quarters into a Dolly Parton pinball machine, the hordes obliviously strolling past.

The two seemed every bit as relaxed during Phoenix’s headlining set, where they made bombastic, melodic rock-and-roll music seem like a humble, joyful pursuit. That’s because, despite all of its urgency, there’s absolutely zero anger in this band’s songbook — which is odd for any type of music, but especially for rock-and-roll.

It felt like huffing pure oxygen. A feel-good festival got the feel-great finale it deserved.